Skip to content

Commit 494dfda

Browse files
authored
Remove useless ecmaVersion in tests (#2724)
1 parent 1f4cb8a commit 494dfda

File tree

6 files changed

+9
-23
lines changed

6 files changed

+9
-23
lines changed

test/empty-brace-spaces.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test({
5252
// `with`
5353
{
5454
code: 'with (foo) {}',
55-
languageOptions: {ecmaVersion: 5, sourceType: 'script'},
55+
languageOptions: {sourceType: 'script'},
5656
},
5757
// We don't check these cases
5858
...ignoredCases.map(code => code.replace(SPACES_PLACEHOLDER, ' ')),
@@ -74,7 +74,7 @@ test({
7474
code: 'with (foo) { }',
7575
output: 'with (foo) {}',
7676
errors: 1,
77-
languageOptions: {ecmaVersion: 5, sourceType: 'script'},
77+
languageOptions: {sourceType: 'script'},
7878
},
7979
],
8080
});

test/no-null.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ test.snapshot({
3636
code,
3737
options: [{checkStrictEquality: false}],
3838
})),
39+
// #1146
40+
{
41+
code: 'foo = Object.create(null)',
42+
languageOptions: {ecmaVersion: 2019},
43+
},
3944
],
4045
invalid: [
4146
'const foo = null',
@@ -102,18 +107,3 @@ test.snapshot({
102107
'Object.create(bar, null)',
103108
],
104109
});
105-
106-
// #1146
107-
test({
108-
testerOptions: {
109-
languageOptions: {
110-
parserOptions: {
111-
ecmaVersion: 2019,
112-
},
113-
},
114-
},
115-
valid: [
116-
'foo = Object.create(null)',
117-
],
118-
invalid: [],
119-
});

test/number-literal-case.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ test({
1414
testerOptions: {
1515
languageOptions: {
1616
parserOptions: {
17-
ecmaVersion: 5,
1817
sourceType: 'script',
1918
},
2019
},

test/numeric-separators-style.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const error = {
77
messageId: 'numeric-separators-style',
88
};
99

10-
const legacyOctalLanguageOptions = {ecmaVersion: 6, sourceType: 'script'};
11-
1210
// Most of these test cases copied from:
1311
// https://github.com/eslint/eslint/blob/master/tests/lib/rules/camelcase.js
1412
test({
@@ -34,7 +32,7 @@ test({
3432
'const foo = 0777777',
3533
'var foo = 0999999',
3634
'let foo = 0111222',
37-
].map(code => ({code, languageOptions: legacyOctalLanguageOptions})),
35+
].map(code => ({code, languageOptions: {sourceType: 'script'}})),
3836

3937
// Binary
4038
'const foo = 0b1010_0001_1000_0101',

test/prefer-bigint-literals.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ test.snapshot({
2424
'BigInt("not-number")',
2525
'BigInt("1_2")',
2626
'BigInt("1\\\n2")',
27-
'BigInt("1\\\n2")',
2827
String.raw`BigInt("\u{31}")`,
2928
],
3029
invalid: [

test/prefer-spread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ test.snapshot({
275275
'do foo.concat(1); while (test)',
276276
{
277277
code: 'with (foo) foo.concat(1)',
278-
languageOptions: {parserOptions: {ecmaVersion: 6, sourceType: 'script'}},
278+
languageOptions: {parserOptions: {sourceType: 'script'}},
279279
},
280280
// Code from example in docs
281281
outdent`

0 commit comments

Comments
 (0)