Skip to content

Commit

Permalink
Fixed excessive parentheses in hash assignments
Browse files Browse the repository at this point in the history
See #30
  • Loading branch information
Anantachai Saothong (Manta) committed May 5, 2018
1 parent f97a705 commit d3ba9f9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions edge/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ function format(content, options = {}) {
inputNode.parent.parent instanceof Stylus.nodes.Selector ||
inputNode.parent.parent instanceof Stylus.nodes.Return ||
inputNode.parent.parent instanceof Stylus.nodes.Arguments ||
inputNode.parent.parent instanceof Stylus.nodes.Object ||
inputNode.parent.parent instanceof Stylus.nodes.BinOp && inputNode.parent.parent.op === '[]'
) === false
const currentIsEmpty = (
Expand Down
9 changes: 8 additions & 1 deletion spec/hash/input.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ body
$abc[three] = $abc.one + 2
$abc.four = $abc[two] + 2
$abc[five] = 2 + 3
$abc.six = 6
$abc.six = 6

$color = {
white: #ffffff
}
$textColor = {
heading: $color.white
}
8 changes: 7 additions & 1 deletion spec/hash/output.styl
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ body {
$abc[three] = $abc.one + 2;
$abc.four = $abc[two] + 2;
$abc[five] = 2 + 3;
$abc.six = 6;
$abc.six = 6;
$color = {
white: #ffffff
};
$textColor = {
heading: $color.white
};

0 comments on commit d3ba9f9

Please sign in to comment.