File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 59
59
"@babel/core" : " ^7.15.5" ,
60
60
"@babel/eslint-parser" : " ^7.15.8" ,
61
61
"@lubien/fixture-beta-package" : " ^1.0.0-beta.1" ,
62
- "@typescript-eslint/parser" : " ^4.32 .0" ,
62
+ "@typescript-eslint/parser" : " ^5.2 .0" ,
63
63
"ava" : " ^3.15.0" ,
64
64
"chalk" : " ^4.1.2" ,
65
65
"enquirer" : " 2.3.6" ,
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ function isStaticMember(node) {
44
44
return false ;
45
45
}
46
46
47
- if ( ! isStatic || isPrivate ) {
47
+ if ( ! isStatic || isPrivate || key . type === 'PrivateIdentifier' ) {
48
48
return false ;
49
49
}
50
50
@@ -54,6 +54,7 @@ function isStaticMember(node) {
54
54
|| isReadonly
55
55
|| typeof accessibility !== 'undefined'
56
56
|| ( Array . isArray ( decorators ) && decorators . length > 0 )
57
+ // TODO: Remove this when we drop support for `@typescript-eslint/parser` v4
57
58
|| key . type === 'TSPrivateIdentifier'
58
59
) {
59
60
return false ;
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ test.snapshot({
16
16
'class A { constructor() {} }' ,
17
17
'class A { get a() {} }' ,
18
18
'class A { set a(value) {} }' ,
19
+ // `private`
20
+ 'class A3 { static #a() {}; }' ,
21
+ 'class A3 { static #a = 1; }' ,
22
+ 'const A3 = class { static #a() {}; }' ,
23
+ 'const A3 = class { static #a = 1; }' ,
19
24
// TODO: enable this test when ESLint support `StaticBlock`
20
25
// Static block
21
26
// 'class A2 { static {}; }',
@@ -216,6 +221,11 @@ test.babel({
216
221
} ,
217
222
} ,
218
223
valid : [
224
+ // `private`
225
+ 'class A2 { static #a() {}; }' ,
226
+ 'class A2 { static #a = 1; }' ,
227
+ 'const A2 = class { static #a() {}; }' ,
228
+ 'const A2 = class { static #a = 1; }' ,
219
229
// Static block
220
230
'class A2 { static {}; }' ,
221
231
] ,
You can’t perform that action at this time.
0 commit comments