-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
style: add @typescript-eslint/eslint-plugin
plugin
#8978
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
Conversation
59237d0
to
1082e14
Compare
Size ReportBundles
Usages
|
1082e14
to
2578557
Compare
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.
It would be more helpful and more comprehensive if we could add an ESLint rule in the project to avoid such issues from happening again. https://typescript-eslint.io/rules/prefer-ts-expect-error
I changed the base branch to Also #8565 |
@ts-expect-error
to replace @ts-ignore
I added the |
@ts-expect-error
to replace @ts-ignore
@typescript-eslinteslint-plugin
plugin to eslint
@typescript-eslinteslint-plugin
plugin to eslint@typescript-eslint/eslint-plugin
plugin to eslint
@@ -0,0 +1,4 @@ | |||
{ | |||
"extends": "./tsconfig.json", | |||
"include": ["packages", "scripts", "./*.ts"] |
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.
The tsconfig.eslint.json
added here is to prevent ESLint from reporting errors for files that are not matched. Please refer to: https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file
b96fea8
to
de5f795
Compare
c0bd115
to
1312b63
Compare
Co-authored-by: 丶远方 <[email protected]>
1312b63
to
8aedc87
Compare
@typescript-eslint/eslint-plugin
plugin to eslint@typescript-eslint/eslint-plugin
plugin
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
I have added the following rules using the
@typescript-eslint/eslint-plugin
:@typescript-eslint/prefer-ts-expect-error
: replace@ts-ignore
with@ts-expect-error
@typescript-eslint/no-unnecessary-type-assertion
: avoid unnecessary type assertions@typescript-eslint/consistent-type-imports
: use thetype
keyword when importing types@typescript-eslint/no-import-type-side-effects
: enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers@typescript-eslint/consistent-indexed-object-style
: ensure consistent usage of indexed object access style in TypeScript codehttps://typescript-eslint.io/rules/