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

fix(eslint-plugin): ignore private identifiers in explicit-module-boundary-types #4046

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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