Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Upgrade "boolean-trivia" lint to new "argument-trivia" lint that uses type info, has quick fixes, etc. #53002
Upgrade "boolean-trivia" lint to new "argument-trivia" lint that uses type info, has quick fixes, etc. #53002
Changes from 19 commits
b4429fa
535145f
09c2548
b8629b8
db07b13
f1e06ed
5dfa6a2
cda5c40
3ae67d9
b39be75
90badae
1df2cea
981991e
9c6f33e
e2492ca
6b7bdfb
f3596ba
88334c0
0875de4
4690507
541e808
81e4208
1f67de8
2ad916f
1fa5786
4d21516
c3496df
9930669
0c9e58e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
? What's this mean?
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.
Ah, this is the lint for when you have
/*param*/ true
, with extra whitespace, and this lint rule apparently determines that style and deletes the extra spaces.I wanted the error range to just be on the spaces but had trouble calculating it.
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.
Huh, do you not always lint with full type information? Is there context around here? Just curious 😄
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.
Only
src
is set up for that. Reasonably, we could also addscripts
to this list, but any root-level file likeHerebyfile.mjs
is not going to be a part of any project.Now, if we get
ts.ProjectService
into ts-eslint... then everything could have type info, as TS would automagically figure out what project each file needs to be in, and allocate it to the implicit project where needed, without tsconfig being configured in eslintrc at all.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.
Also, I've actually been trying to drop type info, because it's just really expensive, but, we get too much value out of the singular type-using lint we have enabled, the one about unused type assertions.
That's a little funny from the POV that this new lint needs type info to be useful. So, oops.
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.
Ooh we're adding in a little set of utilities for calling these checker APIs directly from services.
getResolvedSignature
doesn't exist right now, but if it did, we could simplify this to:How does that make you feel? And if it's not negative, are there any other APIs you think would be good to make available?
Right now we just have
getSymbolAtLocation
andgetTypeAtLocation
wrapped.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.
I personally don't mind the couple of lines to make this work, but, I'm also not writing rules all day.
This file was deleted.
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.
This case is now "okay" because the lint takes the last comment as the hint, which I think is correct and is needed to handle cases where we put other comments before the parameter.