-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
enable @typescript-eslint/no-unused-vars
#57123
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@microsoft-github-policy-service agree |
@typescript-eslint/no-unused-vars
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.
You should see #55139 for context. There are some unfortunate caveats, I'm afraid.
Well, we could of course ignore lines for JSDoc, like you've done here. Maybe that's enough and we can live with it to avoid compiler errors. |
Yes, I think that (at least for now) it seems like an easy task to suppress the <5 places with JSDoc issues in order to get the benefit of this rule applying throughout the whole codebase. |
Generally speaking, I prefer the settings and changes in #55139, besides the JSDoc plugin thing. That being said, the regex should probably be changed to |
I also think we could remove |
The scripts are currently inconsistent as to their use of typedefs or import type nodes; can you switch them all to be import type nodes? At least for the ones that aren't compound like |
Sure — my thinking was to create typedefs for ones that are used more than once, since the imports are long, but I can inline the typedefs if you like that 👍🏻 |
That makes sense, though I think having the code be more easily copy-paste-able between the rules is probably worthwhile. Eventually we'll have #57207, though. That'll be awesome. |
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.
Looks good to me, thanks for bearing with all of my comments.
No worries! Thanks for the detailed review. Would you be open to future PRs turning on other ESLint rules for the codebase? |
Enabling the rules that use type checking is a bit of a perf hole; I wouldn't attempt to enable any of those unless there are some that look super valuable. Last I checked There may be others that are valuable but I think it really depends. |
I'll look into the type-checked lint rules and maybe do some performance monitoring. |
Ah, I was thinking of But generally, know that it isn't a goal to enable every lint rule; the codebase is huge and it slows down linting and editor performance. Most on the team don't even run eslint in the editor for that reason. We really only want cheap rules / rules that have high value. |
Resolves the TODO comment regarding enabling the ESLint rule
@typescript-eslint/no-unused-vars
Fixes #57124