Uh oh!
There was an error while loading. Please reload this page.
enable @typescript-eslint/no-unused-vars - #57123
Conversation
TypeScript Bot (typescript-bot)
commented
Jan 22, 2024
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Abraham Guo (abrahamguo)
commented
Jan 22, 2024
@microsoft-github-policy-service agree |
@typescript-eslint/no-unused-varsThere was a problem hiding this comment.
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Abraham Guo (abrahamguo)
commented
Jan 22, 2024
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Jake Bailey (jakebailey)
commented
Jan 22, 2024
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Jake Bailey (jakebailey)
commented
Jan 29, 2024
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 |
Abraham Guo (abrahamguo)
commented
Jan 29, 2024
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 👍🏻 |
Jake Bailey (jakebailey)
commented
Jan 29, 2024
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. |
Uh oh!
There was an error while loading. Please reload this page.
Jake Bailey (jakebailey)
left a comment
There was a problem hiding this comment.
Looks good to me, thanks for bearing with all of my comments.
Abraham Guo (abrahamguo)
commented
Jan 29, 2024
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. |
Abraham Guo (abrahamguo)
commented
Jan 29, 2024
I'll look into the type-checked lint rules and maybe do some performance monitoring. |
Jake Bailey (jakebailey)
commented
Jan 29, 2024
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-varsFixes#57124