Skip to content

Commit

Permalink
Update: fix indent bug with binary operators/ignoredNodes (fixes #9882)
Browse files Browse the repository at this point in the history
  • Loading branch information
not-an-aardvark committed Feb 6, 2018
1 parent f8d343f commit dce8207
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/rules/indent.js
Expand Up @@ -1043,7 +1043,6 @@ module.exports = {
offsets.ignoreToken(operator);
offsets.ignoreToken(tokenAfterOperator);
offsets.setDesiredOffset(tokenAfterOperator, operator, 0);
offsets.setDesiredOffsets([tokenAfterOperator.range[1], node.range[1]], tokenAfterOperator, 1);
},

"BlockStatement, ClassBody"(node) {
Expand Down
9 changes: 9 additions & 0 deletions tests/lib/rules/indent.js
Expand Up @@ -4694,6 +4694,15 @@ ruleTester.run("indent", rule, {
`,
options: [4, { ignoredNodes: ["JSXOpeningElement"] }]
},
{
code: unIndent`
foo &&
<Bar
>
</Bar>
`,
options: [4, { ignoredNodes: ["JSXElement", "JSXOpeningElement"] }]
},
{
code: unIndent`
(function($) {
Expand Down

0 comments on commit dce8207

Please sign in to comment.