-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: enable prefer-ast-types-enum
internal rule
#1514
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
chore: enable prefer-ast-types-enum
internal rule
#1514
Conversation
Thanks for the PR, @G-Rath! 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 on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Looking over the diff, there are some pretty decent ones in there that have been caught & fixed.
|
Co-Authored-By: Brad Zacher <brad.zacher@gmail.com>
@armano2 now this should be good & ready for review :) |
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.
Almost all changes are correct.
If you undo the changes to the files I've marked, and disable with a comment, I'm happy to merge this.
We could probs improve it with type info, but it's probs not worth it. The cases are pretty edge-casey, and fine for the internal usage.
The rule in #315 will cover this so I'm happy with a few disable comments until we get around to finishing that rule.
I should probably prioritise finishing some of those "abandoned" PRs.
packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts
Outdated
Show resolved
Hide resolved
👍
I'm happy to help out with this - I've already got a couple on my plate that I'd like to action but they're all somewhat complicated or have high depth, so I'm keen for some lighter-weight contributions to sink my teeth into for upskilling 🙂 (In particular, learning how to use the types provided by TypeScript properly) |
`, | ||
errors: [ | ||
{ | ||
data: { enumName: 'AST_NODE_TYPES', literal: AST_NODE_TYPES.Literal }, |
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 haha hoisted by my own petard!
packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
I think that while cool it's probably worth focusing our efforts on getting #315 across the line before iterating any further on this rule, as I think we've got the majority of the false false positives, and it'll also make for a good double-blind test for that rule :) |
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.
LGTM
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.
legendary, thanks!
prefer-ast-types-enum
internal rule
This is based off #1508, so shouldn't be merged until after that one has.