Skip to content

Commit

Permalink
Update: avoid requiring NaN spaces of indentation (fixes #9083) (#9085)
Browse files Browse the repository at this point in the history
This fixes an issue where the `indent` rule would sometimes expect "NaN spaces" of indentation when an `"off"` option was used.
  • Loading branch information
not-an-aardvark authored and kaicataldo committed Aug 9, 2017
1 parent c93a853 commit bd09cd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/indent.js
Expand Up @@ -783,7 +783,7 @@ module.exports = {
offsets.setDesiredOffsets(
[startToken.range[1], endToken.range[0]],
startToken,
offset === "first" ? 1 : offset
typeof offset === "number" ? offset : 1
);
offsets.setDesiredOffset(endToken, startToken, 0);

Expand Down
18 changes: 18 additions & 0 deletions tests/lib/rules/indent.js
Expand Up @@ -4915,6 +4915,24 @@ ruleTester.run("indent", rule, {
);
}
`
},
{
code: unIndent`
a(b
, c
)
`,
options: [2, { CallExpression: { arguments: "off" } }]
},
{
code: unIndent`
a(
new B({
c,
})
);
`,
options: [2, { CallExpression: { arguments: "off" } }]
}
],

Expand Down

0 comments on commit bd09cd5

Please sign in to comment.