Skip to content

Bug: [consistent-type-imports] imported type used in 'satisfies' reported as 'used by decorator metadata' #6077

Closed as not planned
@jet2jet

Description

@jet2jet

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.

Playground Link

https://typescript-eslint.io/play#ts=4.9.3&sourceType=module&code=PTAEAEBcGcFoFMAeAHeBjSCBOWD2WBYAKAEsBbZfSUSAT1VAG9QAxXXUAX1ADM8zQAch7tBAbmJpcAO2jURHALxNioUAEMAXEIWDi3aOsgloPEvGit2EokkpZqAE3g91AVwA2868SA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6MgeyeUuX0Ra0ipWpQC2xDtHyoMkRNGhTI4MAF8QaoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

// @ts-expect-error
import type { Foo } from 'foo';
const foo = {
  a: 'foo'
} satisfies Foo;
export default foo;

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/consistent-type-imports": "error"
  },
};

tsconfig

{
  "compilerOptions": {
    // ...
  }
}

Expected Result

No error reported

Actual Result

Error reported: Type import "Foo" is used by decorator metadata. 2:1 - 2:32

Additional Info

No response

Versions

package version
@typescript-eslint/eslint-plugin 5.44.0
@typescript-eslint/parser 5.44.0
TypeScript 4.9.3
ESLint 8.15.0
node 18.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions