{ "rules": { "no-throw-literal": "error" } }
Just that in a file somewhere
Expected Result
This should be a parse-error and should not be linted on.
Actual Result
Parser creates a ThrowStatement
with argument
set to null, which breaks rules downstream, see eslint/eslint#13143 for context
Additional Info
[Error - 1:41:32 PM] TypeError: Cannot read property 'type' of null
Occurred while linting [fileName].ts:132
at Object.couldBeError (eslint/lib/rules/utils/ast-utils.js:1262:22)
at ThrowStatement (eslint/lib/rules/no-throw-literal.js:38:31)
at eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (eslint/lib/linter/node-event-generator.js:254:26)
at NodeEventGenerator.applySelectors (eslint/lib/linter/node-event-generator.js:283:22)
at NodeEventGenerator.enterNode (eslint/lib/linter/node-event-generator.js:297:14)
at CodePathAnalyzer.enterNode (eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23)
at eslint/lib/linter/linter.js:936:32
Versions
package version@typescript-eslint/parser
^2.13.0
TypeScript
^3.8.2
ESLint
5.16.0
node
12.16.0
npm
6.13.7
thorn0, avinoamsn, Belco90, DanielSWolf, KillyMXI and 3 moreExE-Boss, KillyMXI and AbdelrahmanHafez
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4