Skip to content

Commit 6f85547

Browse files
Merge pull request #2363 from c0rydoras/fix/classic-decorator-no-classic-methods/private-identifiers
fix: classic-decorator-no-classic-methods matching private identifiers
2 parents 659655a + 4779d5c commit 6f85547

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/rules/classic-decorator-no-classic-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656
if (!inClassExtends) {
5757
return;
5858
}
59-
if (node.object.type !== 'ThisExpression') {
59+
if (node.object.type !== 'ThisExpression' || node.property.type === 'PrivateIdentifier') {
6060
return;
6161
}
6262

tests/lib/rules/classic-decorator-no-classic-methods.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ ruleTester.run('classic-decorator-no-classic-methods', rule, {
4747
foo = otherClass.get('bar');
4848
}
4949
`,
50+
`
51+
class Foo extends Bar {
52+
#get = (k) => {};
53+
foo = () => {
54+
this.#get('abc');
55+
}
56+
}
57+
`,
5058
],
5159

5260
invalid: [

0 commit comments

Comments
 (0)