New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: [consistent-type-imports] Attempts to fix the wrong import statement #7209
Comments
Fun! And thanks for using
|
Is this little bit same as what @bradzacher commented to another issue #7214 (comment):
I tried to check if there are any tests cases with verbatimModuleSyntax but I couldn't find any in code base. Maybe it would be good in future to add some tests that would check how rules behave with it? |
For people's information: this rule in general doesn't handle duplicate imports very well. In this code: import "./foo-bar.js";
import type { Foo, Bar } from "./foo-bar.js";
export class Baz {
@console.log bar!: Bar;
} It wants to fix the second import, but it locates the first import statement instead, which has no |
Re |
Before You File a Bug Report Please Confirm You Have Done The Following...
Issue Description
@typescript-eslint/consistent-type-imports went wrong with side effect import and type import.
Reproduction Repository Link
https://github.com/OpportunityLiu/consistent-type-imports-repro
Repro Steps
yarn install
yarn eslint baz.ts
Versions
@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
The text was updated successfully, but these errors were encountered: