Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
fix(experimental-utils): fixeslint-utils' negative predicates' return types inast-utils#3461
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@MichaelDeBoey! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day. |
12b9c08 to3547451Comparebradzacher commentedJun 6, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
While Idefinitely like the idea of this, ultimately this doesn't actually do anything. The type of
|
MichaelDeBoey commentedJun 7, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@bradzacher You think there's another way of getting the correct type then? Edit: postedhttps://twitter.com/MichaelDeBoey93/status/1401920255404953604 to get some help |
bradzacher commentedJun 7, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There is unfortunately not right now. Edit: orta dug up the issue:microsoft/TypeScript#29317 |
MichaelDeBoey commentedJun 7, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@bradzachermicrosoft/TypeScript#29317 is the issue as mentioned by@orta inhttps://twitter.com/orta/status/1401934733634846723 So there's no other way to do this then? @bradzacher Making the interfacePunctuatorTokenextendsBaseToken{type:AST_TOKEN_TYPES.Punctuator;value:'=>'|'}'|']'|')'|':'|','|'{'|'['| ...;} |
bradzacher commentedJun 7, 2021
Correct, but then we would have to attempt to list out every single possible token string and keep it up to date. Not an impossible task, just a (relatively) low value one. Also it's not a great thing because custom parsers (babel, Vue, markdown, angular) may add new tokens, which then causes our types to be wrong. By-and-large our rules shouldn't make assumptions about the parser. |
MichaelDeBoey commentedJun 7, 2021
@bradzacher This PR adds type-safety and type guards for those functions. What do you think? I'm happy to create another PR to update the |
f6136c9 tobfbf536Comparenx-cloudbot commentedJun 12, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Nx Cloud ReportCI ran the following commands for commit0127fc9. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 fromNxCloud. |
…urn types in `ast-utils`
MichaelDeBoey commentedJun 14, 2021
@bradzacher Now that#3496 is merged, this one can be merged too I think? |
bradzacher left a comment
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.
yup - looks good now and it should all work!!
Just like it's done with
isNotCommentTokentypescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
Lines 49 to 51 ind4f0774