Skip to content

Commit

Permalink
fix(eslint-plugin): [explicit-member-accessibility] private fields ca…
Browse files Browse the repository at this point in the history
…nnot have accessibility modifiers (#4117)
  • Loading branch information
danny-may committed Nov 11, 2021
1 parent 75e2ae0 commit 81b25c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -214,6 +214,10 @@ export default util.createRule<Options, MessageIds>({
| TSESTree.PropertyDefinition
| TSESTree.TSAbstractPropertyDefinition,
): void {
if (propertyDefinition.key.type === AST_NODE_TYPES.PrivateIdentifier) {
return;
}

const nodeType = 'class property';

const { name: propertyName } = util.getNameFromMember(
Expand Down
Expand Up @@ -342,7 +342,7 @@ class Test {
#bar() {}
}
`,
options: [{ accessibility: 'no-public' }],
options: [{ accessibility: 'explicit' }],
},
],
invalid: [
Expand Down

0 comments on commit 81b25c1

Please sign in to comment.