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
feat(eslint-plugin): [naming-convention] support the auto-accessor syntax #8084
Conversation
Thanks for the PR, @arka1002! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@Josh-Cena can you please take a look. |
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.
Functionally looks great, thanks! Nice and straightforward. 🙂
Just requesting changes to get it documented too. Every selector option should be.
Btw, no need to ping individuals for review. We have a queue and we get to things when we can.
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.
Progress, thanks for working on it!
I'll defer to @bradzacher for final approval - but I think having more docs and matching test coverage to the new feature would be good.
packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/tests/rules/naming-convention/cases/autoAccessor.test.ts
Outdated
Show resolved
Hide resolved
Adding back |
@JoshuaKGoldberg I don't have the button to re-request 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.
I think the direction is good - but the two new sub-groups shouldn't have overlapping matches, no?
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.
[Testing] It's good to have created a test file for classicAccessor
- but there should also be a test case file for accessor
too! (so, three *.test.ts
files around accessors, not two)
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 yes! Added here 88acaae
. There are a bunch of tests in the other file too
typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts
Lines 610 to 625 in 1200b4c
class Ignored { | |
private static get some_name() {} | |
get IgnoredDueToModifiers() {} | |
} | |
`, | |
options: [ | |
{ | |
selector: 'default', | |
format: ['PascalCase'], | |
}, | |
{ | |
selector: 'accessor', | |
format: ['snake_case'], | |
modifiers: ['private', 'static'], | |
}, | |
], |
Oh, I think I got lost in the GitHub UI - I see you did re-request review from at least me. Sorry about that! |
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.
Whoohoo, this is lovely! 🙌
Thanks for working on it & iterating with us @arka1002. Really nicely done final result here.
I just have the one docs request, but nothing left from me in code. Will defer to @bradzacher. 🙂
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.
Fixes: #7823
PR Checklist
Overview
Adds auto-accessor in the accessor selector.