-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
chore(eslint): update eslint no-unused-vars
rules
#9028
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
Size ReportBundles
Usages
|
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.
Thanks for your contribution, but we don't think this change is necessary. Keeping both ESLint and TypeScript at the same time obviously won't affect anything, but it can better alert us to problems in the code.
However, it override the inspection of JS files, causing unused imports in JS not to trigger errors. Additionally, this rule doesn't take effect within TS files. As a result, unused imports |
Then we need to lint both JS and TS files. |
In our current ESLint rules, we have enabled Based on the above, I believe we should only apply these checks to JavaScript files. |
e9cf5f1
to
6b9f6f6
Compare
We have excluded the
no-unused-vars
rule for TypeScript (.ts
) files in our existing ESLint configuration, as TypeScript inherently checks for unused variables. However, if we don't configure this rule, ESLint won't perform theno-unused-vars
check for TypeScript files. Nevertheless, we do need to enable this rule for JavaScript (.js
) files to ensure that variables defined in JavaScript files are also being utilized.