-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Issue Description
When running eslint on the repo as is, everything works as expected. However, when upgrading to v5.44 first, the lint crashes with the message below. See Repro Steps for more info.
Oops! Something went wrong! :(
ESLint: 8.28.0
TypeError: Cannot read properties of undefined (reading 'after')
Occurred while linting /home/a/git/async-css-plugin/src/AsyncCssPlugin.ts:2
Rule: "@typescript-eslint/keyword-spacing"
at ImportDeclaration[importKind=type] (/home/a/git/async-css-plugin/node_modules/@typescript-eslint/eslint-plugin/dist/rules/keyword-spacing.js:65:40)
at ruleErrorHandler (/home/a/git/async-css-plugin/node_modules/eslint/lib/linter/linter.js:1115:28)
at /home/a/git/async-css-plugin/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (/home/a/git/async-css-plugin/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/home/a/git/async-css-plugin/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (/home/a/git/async-css-plugin/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (/home/a/git/async-css-plugin/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
at CodePathAnalyzer.enterNode (/home/a/git/async-css-plugin/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
at /home/a/git/async-css-plugin/node_modules/eslint/lib/linter/linter.js:1150:32
Reproduction Repository Link
https://github.com/andreashuber69/async-css-plugin
Repro Steps
git clone https://github.com/andreashuber69/async-css-plugin
cd async-css-plugin
npm install
npx eslint src --ext .js,.ts
The lint should complete without error. If you then continue with:
npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser
npx eslint src --ext .js,.ts
(the above installs v5.44 of both packages, v5.43 was installed before)
The lint crashes, see output above.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.44.0 |
@typescript-eslint/parser |
5.44.0 |
TypeScript |
4.9.3 |
ESLint |
8.28.0 |
node |
18.12.1 |
pomek, ximex, xumepadismal, Jomshir98, omril1 and 1 more
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin