Skip to content

[consistent-type-imports] support decorator metaData without specifying project #4638

@xboy2012

Description

@xboy2012

For projects that use "emitDecoratorMetaData: true" in tsconfig.json

If we want to use consistent-type-imports, we have to specify project in parserOptions, in order to prevent the rule from reporting false positives.

Everything works OK as we configure as above. But we encounter performance issues. Linting time is too long.

As we specified project in parserOptions, then we uses type-aware linting(In other words, we need to compile source code by typescript).

However, is it really the best practice to do like this?

  • I only need the parser to understand emitDecoratorMetaData: true
  • I do not need the time-costing type-aware linting.

Is there a way to just tell consistent-type-imports to act as if emitDecoratorMetaData: true is set, without really compiling with typescript?

such as add an option to the rule

"@typescript-eslint/consistent-type-imports": ['error', { emitDecoratorMetaData: true }]

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: parserIssues related to @typescript-eslint/parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions