-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
chore(repo): enable consistent-type-imports
for typescript files
#1325
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. IMO though, doing this manually is an unmaintainable chore. If we want this, we should throw
'@typescript-eslint/consistent-type-imports': 'error'
into the ESLint config. This rule has an auto-fixer.
ok, i add it, and changed the code that does not conform to this rule. btw, my first commit is not manually, it's fixed by this rule~ |
😅 Makes sense |
b353836
to
3038271
Compare
@jerry-lllman Please fill in the Description of the pull request template. I'm familiar with the rule and it's intent and purpose, but why do we need to enforce this? Please make your case in the Description. |
@shellscape I have added the description🥳 |
consistent-type-imports
for typescript files
Rollup Plugin Name:
{name}
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
we added eslint rule
'@typescript-eslint/consistent-type-imports': 'error'
It can make some optimizations.
For example, if you
import typescript
, the whole typescript library will be imported, but theimport type typescript
this library will not be imported, saving a lot of volume.typescript
documentation is described as followshttps://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export