Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Parsing: strictly enforce the produced AST matches the spec and enforce most "error recovery" parsing errors #1852

Closed
Labels
ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedenhancementNew feature or requestpackage: parserIssues related to @typescript-eslint/parser
Milestone
@steelbrain

Description

@steelbrain
{"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

packageversion
@typescript-eslint/parser^2.13.0
TypeScript^3.8.2
ESLint5.16.0
node12.16.0
npm6.13.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedenhancementNew feature or requestpackage: parserIssues related to @typescript-eslint/parser

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp