Skip to content
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

Merged
merged 30 commits into from Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1662bd3
fix: support auto-accessor for naming convention
arka1002 Dec 17, 2023
25feaba
chore: fix CI failures
arka1002 Dec 17, 2023
2d47b74
Merge branch 'main' into issue-7823
arka1002 Dec 19, 2023
c1b1796
Merge branch 'main' into issue-7823
arka1002 Dec 23, 2023
1fe2d01
Merge branch 'main' into issue-7823
arka1002 Jan 4, 2024
2bb04b7
Merge branch 'main' into issue-7823
arka1002 Jan 4, 2024
4636e6d
Merge branch 'main' into issue-7823
arka1002 Jan 5, 2024
0149a62
chore: making auto-accessor a modifier of accessor
arka1002 Jan 5, 2024
2351b09
chore: fix prettier issues
arka1002 Jan 6, 2024
45a5118
chore: docs for auto-accessor syntax
arka1002 Jan 6, 2024
320320e
Merge branch 'main' into issue-7823
arka1002 Jan 7, 2024
c08c4cf
fix: make autoAccessor a selector
arka1002 Jan 8, 2024
3762356
fix: prettier and docs
arka1002 Jan 8, 2024
c4ae266
fix: small typo
arka1002 Jan 8, 2024
ec931d8
Merge branch 'main' into issue-7823
arka1002 Jan 8, 2024
9a42efe
Merge branch 'main' into issue-7823
arka1002 Jan 11, 2024
47fd96a
chore: add more test coverage and docs
arka1002 Jan 12, 2024
3d05845
Merge branch 'main' into issue-7823
arka1002 Jan 12, 2024
bd7947a
fix: support the abstract accessor
arka1002 Jan 13, 2024
9148131
chore: change accessor to classicAccessor selector
arka1002 Jan 13, 2024
d8114e8
chore: group classic and auto selectors
arka1002 Jan 13, 2024
468549d
chore: fix a small type error
arka1002 Jan 13, 2024
9fbc50c
Merge branch 'main' into issue-7823
arka1002 Jan 13, 2024
e6a1d27
chore: add docs
arka1002 Jan 13, 2024
813b1ec
Merge branch 'main' into issue-7823
arka1002 Jan 16, 2024
11d81c1
chore: slight mistake
arka1002 Feb 5, 2024
16eb834
Merge branch 'issue-7823' of github.com:arka1002/typescript-eslint in…
arka1002 Feb 5, 2024
88acaae
chore: add accessor test file
arka1002 Feb 6, 2024
eb935d0
chore: move docs
arka1002 Feb 21, 2024
8f1c37d
fix selector
bradzacher Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/eslint-plugin/src/rules/naming-convention.ts
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
Expand Up @@ -518,7 +518,10 @@ export default createRule<Options, MessageIds>({

// #region accessor

'Property[computed = false]:matches([kind = "get"], [kind = "set"])': {
[[
'Property[computed = false]:matches([kind = "get"], [kind = "set"])',
AST_NODE_TYPES.AccessorProperty,
].join(', ')]: {
validator: validators.accessor,
handler: (node: TSESTree.PropertyNonComputedName, validator): void => {
const modifiers = new Set<Modifiers>([Modifiers.public]);
Expand Down
Expand Up @@ -9,6 +9,10 @@ createTestCases([
'class Ignored { private set "%"(ignored) {} }',
'class Ignored { private static get %() {} }',
'class Ignored { static get #%() {} }',
'class Ignored { accessor % = 10; }',
'class Ignored { accessor #% = 10; }',
'class Ignored { static accessor % = 10; }',
'class Ignored { static accessor #% = 10; }',
],
options: {
selector: 'accessor',
Expand Down