Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Labels
Milestone
Description
{"rules": {"no-throw-literal":"error" }}
throw
Just that in a file somewhere
Expected Result
This should be a parse-error and should not be linted on.
Actual Result
Parser creates aThrowStatement
withargument
set to null, which breaks rules downstream, seeeslint/eslint#13143 for context
Additional Info
[Error - 1:41:32 PM] TypeError: Cannot read property 'type' of nullOccurred 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 |