"Expected NaN spaces" indent error with multiline string and arguments: 'off' #9083
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
indent
Relates to the `indent` rule
rule
Relates to ESLint's core rules
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue.
This is a reduced test case showing the issue:
What did you expect to happen?
Ideally no error, but if there is an error, it should be sensible.
What actually happened? Please include the actual, raw output from ESLint.
eslint gives this error:
Running
eslint --fix
treats NaN as 0 and removes all indentation from all affected lines.Changing the multiline string to a single-line string fixes the issue, and removing
arguments: 'off'
in the config also fixes the issue.Context:
This type of code came up when converting multiline strings from CoffeeScript (example), and it appears a number of times in my codebase. A workaround is to rewrite the multiline strings as single-line strings, but certainly would be nice for this to be fixed within eslint.
The text was updated successfully, but these errors were encountered: