-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
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
@typescript-eslint/consistent-type-imports went wrong with side effect import and type import.
$ /workspaces/consistent-type-imports-repro/node_modules/.bin/eslint baz.ts
Oops! Something went wrong! :(
ESLint: 8.44.0
Error: Non-null Assertion Failed: Expected to find a } for the ImportDeclaration.
Occurred while linting /workspaces/consistent-type-imports-repro/baz.ts:1
Rule: "@typescript-eslint/consistent-type-imports"
at Object.nullThrows (/workspaces/consistent-type-imports-repro/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js:23:15)
at fixInsertNamedSpecifiersInNamedSpecifierList (/workspaces/consistent-type-imports-repro/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js:406:44)
at fixToValueImportDeclaration (/workspaces/consistent-type-imports-repro/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js:614:55)
at fixToValueImportDeclaration.next (<anonymous>)
at Object.fix (/workspaces/consistent-type-imports-repro/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js:262:56)
at fix.next (<anonymous>)
at Function.from (<anonymous>)
at normalizeFixes (/workspaces/consistent-type-imports-repro/node_modules/eslint/lib/linter/report-translator.js:182:33)
at /workspaces/consistent-type-imports-repro/node_modules/eslint/lib/linter/report-translator.js:349:49
at Object.report (/workspaces/consistent-type-imports-repro/node_modules/eslint/lib/linter/linter.js:1021:41)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Reproduction Repository Link
https://github.com/OpportunityLiu/consistent-type-imports-repro
Repro Steps
- clone the repo
yarn installyarn eslint baz.ts
Versions
| package | version |
|---|---|
@typescript-eslint/eslint-plugin |
6.0.0 |
@typescript-eslint/parser |
6.0.0 |
@typescript-eslint/scope-manager |
6.0.0 |
@typescript-eslint/typescript-estree |
6.0.0 |
@typescript-eslint/type-utils |
6.0.0 |
@typescript-eslint/utils |
6.0.0 |
TypeScript |
5.1.6 |
ESLint |
8.44.0 |
node |
18.16.1 |
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 workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.