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 some TODOs #1567

Merged
merged 1 commit into from
Nov 2, 2021
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
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