Skip to content

Commit c10e2ba

Browse files
authored
Fix some TODOs (#1567)
1 parent a2ba25e commit c10e2ba

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

test/no-static-only-class.mjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ test.snapshot({
2121
'class A3 { static #a = 1; }',
2222
'const A3 = class { static #a() {}; }',
2323
'const A3 = class { static #a = 1; }',
24-
// TODO: enable this test when ESLint support `StaticBlock`
2524
// Static block
26-
// 'class A2 { static {}; }',
25+
'class A2 { static {}; }',
2726
],
2827
invalid: [
2928
'class A { static a() {}; }',

test/prefer-number-properties.mjs

+8-3
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ const errorNaN = [
169169
},
170170
];
171171

172-
// TODO: Add following tests whenESLint support `proposal-class-fields`
173-
// 'class Foo {NaN = 1}',
174-
// 'class Foo {[NaN] = 1}',
175172
test({
176173
valid: [
177174
'const foo = Number.NaN;',
@@ -202,6 +199,9 @@ test({
202199
'class NaN {}',
203200
'const Foo = class NaN {}',
204201
'class Foo {NaN(){}}',
202+
'class Foo {#NaN(){}}',
203+
'class Foo3 {NaN = 1}',
204+
'class Foo {#NaN = 1}',
205205
outdent`
206206
NaN: for (const foo of bar) {
207207
if (a) {
@@ -289,6 +289,11 @@ test({
289289
output: 'const foo = Number.NaN.toString();',
290290
errors: errorNaN,
291291
},
292+
{
293+
code: 'class Foo3 {[NaN] = 1}',
294+
output: 'class Foo3 {[Number.NaN] = 1}',
295+
errors: errorNaN,
296+
},
292297
],
293298
});
294299

0 commit comments

Comments
 (0)