Setting "ArrayExpression": "off" in indent rule causes eslint to crash #9157
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.
I'm just running eslint on my small/medium sized node/react/es6 codebase. I can't tell exactly what part of my code is causing the problem because an error is happening in eslint itself.
What did you expect to happen?
The linter to run normally
What actually happened? Please include the actual, raw output from ESLint.
Cannot read property 'range' of null
TypeError: Cannot read property 'range' of null
at SourceCode.getTokenBefore (/home/git/myproject/node_modules/eslint/lib/token-store/index.js:303:17)
at getFirstToken (/home/git/myproject/node_modules/eslint/lib/rules/indent.js:784:40)
at elements.forEach (/home/git/myproject/node_modules/eslint/lib/rules/indent.js:806:41)
at Array.forEach (native)
at addElementListIndent (/home/git/myproject/node_modules/eslint/lib/rules/indent.js:804:22)
at Object.ArrayExpression, ArrayPattern [as listener] (/home/git/myproject/node_modules/eslint/lib/rules/indent.js:965:17)
at Program:exit.listenerCallQueue.filter.forEach.nodeInfo (/home/git/myproject/node_modules/eslint/lib/rules/indent.js:1444:55)
at Array.forEach (native)
at Linter.Program:exit (/home/git/myproject/node_modules/eslint/lib/rules/indent.js:1444:26)
at emitOne (events.js:101:20)
at Linter.emit (events.js:188:7)
NOTE:
The culprit here seems to be setting "ArrayExpression": "off". If I omit it or set it to "first", the linter runs as expected.
The text was updated successfully, but these errors were encountered: