-
-
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 workingpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager
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 upgrading from typescript-eslint 5.x.x to 6.x.x I started seeing false positive errors "used by decorator metadata" for types that are used in constructor parameters, even if the class itself is not using any decorators at all.
So given these two files
export class ClassA {}
import type { ClassA } from "./classA";
export class ClassB {
public constructor(classA: ClassA) {}
}
we would expect no errors, as no decorators are involved in either file.
Instead we get an error reported for the import of ClassA
:
1:1 error Type import "ClassA" is used by decorator metadata @typescript-eslint/consistent-type-imports
Reproduction Repository Link
https://github.com/mpotthoff/consistent-type-imports-decorator-bug
Repro Steps
- clone the repo
npm install
npx eslint classB.ts
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
6.2.0 |
@typescript-eslint/parser |
6.2.0 |
@typescript-eslint/scope-manager |
6.2.0 |
@typescript-eslint/typescript-estree |
6.2.0 |
@typescript-eslint/type-utils |
6.2.0 |
@typescript-eslint/utils |
6.2.0 |
TypeScript |
5.1.6 |
ESLint |
8.45.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 workingpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager