Skip to content
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

feat: remove @typescript-eslint/consistent-type-imports #110

Closed
wants to merge 1 commit into from

Conversation

zanminkian
Copy link
Contributor

Remove @typescript-eslint/consistent-type-imports to improve compatibility for Angular and Nest.

In Ioc framework, code below are commonly used by developer.

import { AClass } from './a-class'

@Injectable()
export class BClass {
  constructor(private readonly aClass: AClass){}
}

After  formatting, code import { AClass } from './a-class' will become import type { AClass } from './a-class', which will  cause error, because typescript complier cannot get metadata by reflection.

remove `@typescript-eslint/consistent-type-imports` to improve compatibility for Angular and Nest
@antfu
Copy link
Owner

antfu commented Sep 2, 2022

Thanks but no. This one I strongly prefer to have. Feel free to override on your local.

@antfu antfu closed this Sep 2, 2022
@zanminkian
Copy link
Contributor Author

zanminkian commented Dec 9, 2022

Now (version 0.33.1), for the dependency-injection projects which, for example, base on nest or angluar, can add a tsconfig.eslint.json to the project root and make sure its compileOptions.emitDecoratorMetadata is true. Because this PR #131 works.

Check https://typescript-eslint.io/rules/consistent-type-imports/#usage-with-emitdecoratormetadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants