Skip to content

Commit

Permalink
Fix some TODOs (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Nov 2, 2021
1 parent a2ba25e commit c10e2ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions test/no-static-only-class.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ test.snapshot({
'class A3 { static #a = 1; }',
'const A3 = class { static #a() {}; }',
'const A3 = class { static #a = 1; }',
// TODO: enable this test when ESLint support `StaticBlock`
// Static block
// 'class A2 { static {}; }',
'class A2 { static {}; }',
],
invalid: [
'class A { static a() {}; }',
Expand Down
11 changes: 8 additions & 3 deletions test/prefer-number-properties.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ const errorNaN = [
},
];

// TODO: Add following tests whenESLint support `proposal-class-fields`
// 'class Foo {NaN = 1}',
// 'class Foo {[NaN] = 1}',
test({
valid: [
'const foo = Number.NaN;',
Expand Down Expand Up @@ -202,6 +199,9 @@ test({
'class NaN {}',
'const Foo = class NaN {}',
'class Foo {NaN(){}}',
'class Foo {#NaN(){}}',
'class Foo3 {NaN = 1}',
'class Foo {#NaN = 1}',
outdent`
NaN: for (const foo of bar) {
if (a) {
Expand Down Expand Up @@ -289,6 +289,11 @@ test({
output: 'const foo = Number.NaN.toString();',
errors: errorNaN,
},
{
code: 'class Foo3 {[NaN] = 1}',
output: 'class Foo3 {[Number.NaN] = 1}',
errors: errorNaN,
},
],
});

Expand Down

0 comments on commit c10e2ba

Please sign in to comment.