Navigation Menu

Skip to content

Commit

Permalink
fix(eslint-plugin): ignore private identifiers in explicit-module-bou…
Browse files Browse the repository at this point in the history
…ndary-types (#4046)
  • Loading branch information
Josh Goldberg committed Nov 1, 2021
1 parent a93cebf commit 80b853d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Expand Up @@ -336,7 +336,10 @@ export default util.createRule<Options, MessageIds>({
return;

case AST_NODE_TYPES.PropertyDefinition:
if (node.accessibility === 'private') {
if (
node.accessibility === 'private' ||
node.key.type === AST_NODE_TYPES.PrivateIdentifier
) {
return;
}
return checkNode(node.value);
Expand All @@ -353,7 +356,10 @@ export default util.createRule<Options, MessageIds>({

case AST_NODE_TYPES.MethodDefinition:
case AST_NODE_TYPES.TSAbstractMethodDefinition:
if (node.accessibility === 'private') {
if (
node.accessibility === 'private' ||
node.key.type === AST_NODE_TYPES.PrivateIdentifier
) {
return;
}
return checkNode(node.value);
Expand Down
Expand Up @@ -82,6 +82,16 @@ export class Test {
}
`,
},
`
export class PrivateProperty {
#property = () => null;
}
`,
`
export class PrivateMethod {
#method() {}
}
`,
{
// https://github.com/typescript-eslint/typescript-eslint/issues/2150
code: `
Expand Down

0 comments on commit 80b853d

Please sign in to comment.