Skip to content

Commit

Permalink
Update ecmaVersion to 2021 (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored Sep 10, 2020
1 parent 33a1268 commit a78cea3
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 35 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
es6: true
},
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@ava/babel": "^1.0.1",
"@babel/code-frame": "7.10.4",
"@lubien/fixture-beta-package": "^1.0.0-beta.1",
"@typescript-eslint/parser": "^4.0.1",
"@typescript-eslint/parser": "^4.1.0",
"ava": "^3.12.1",
"babel-eslint": "^10.1.0",
"chalk": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Configure it in `package.json`.
"es6": true
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": 2021,
"sourceType": "module"
},
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion test/better-regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import rule from '../rules/better-regex';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/catch-error-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ERROR_MESSAGE_ID = 'error';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/consistent-function-scoping.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import visualizeRuleTester from './utils/visualize-rule-tester';
const ruleTester = avaRuleTester(test, {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
ecmaVersion: 2021,
ecmaFeatures: {
jsx: true
}
Expand Down Expand Up @@ -652,7 +652,7 @@ typescriptRuleTester.run('consistent-function-scoping', rule, {
const visualizeTester = visualizeRuleTester(test, {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
ecmaVersion: 2021,
ecmaFeatures: {
jsx: true
}
Expand Down
4 changes: 2 additions & 2 deletions test/import-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import visualizeRuleTester from './utils/visualize-rule-tester';
const ruleTester = avaRuleTester(test, {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down Expand Up @@ -585,7 +585,7 @@ ruleTester.run('import-style', rule, {
const visualizeTester = visualizeRuleTester(test, {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/integration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
ecmaFeatures: {
jsx: true
}
Expand Down
2 changes: 1 addition & 1 deletion test/new-for-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {enforceNew, disallowNew} from '../rules/utils/builtins';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
},
// Make sure globals don't effect shadowed check result
Expand Down
2 changes: 1 addition & 1 deletion test/no-console-spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import rule from '../rules/no-console-spaces';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/no-fn-reference-in-iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const reduceLikeMethods = [

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/no-for-loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import rule from '../rules/no-for-loop';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/no-keyword-prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import rule from '../rules/no-keyword-prefix';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/no-null.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const SUGGESTION_REMOVE_MESSAGE_ID = 'remove';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
4 changes: 2 additions & 2 deletions test/no-object-as-default-parameter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import visualizeRuleTester from './utils/visualize-rule-tester';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down Expand Up @@ -172,7 +172,7 @@ ruleTester.run('no-object-as-default-parameter', rule, {

const visualizeTester = visualizeRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/no-process-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import rule from '../rules/no-process-exit';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/no-reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MESSAGE_ID_REDUCE_RIGHT = 'reduceRight';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/no-unused-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ruleTester = avaRuleTester(test, {
es6: true
},
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
4 changes: 2 additions & 2 deletions test/no-useless-undefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const messageId = 'no-useless-undefined';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down Expand Up @@ -242,7 +242,7 @@ typescriptRuleTester.run('no-useless-undefined', rule, {

const visualizeTester = visualizeRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
21 changes: 19 additions & 2 deletions test/number-literal-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ruleTester = avaRuleTester(test, {
es6: true
},
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});
const babelRuleTester = avaRuleTester(test, {
Expand Down Expand Up @@ -58,7 +58,17 @@ const tests = {

// Not number
'const foo = \'0Xff\'',
'const foo = \'0Xffn\''
'const foo = \'0Xffn\'',

// Numeric separator
'const foo = 123_456',
'const foo = 0b10_10',
'const foo = 0o1_234_567',
'const foo = 0xDEED_BEEF',
'const foo = 123_456n',
'const foo = 0b10_10n',
'const foo = 0o1_234_567n',
'const foo = 0xDEED_BEEFn'
],
invalid: [
// Number
Expand Down Expand Up @@ -143,6 +153,13 @@ const tests = {
console.log('invalid');
}
`
},

// Numeric separator
{
code: 'const foo = 0XdeEd_Beefn',
errors: [error],
output: 'const foo = 0xDEED_BEEFn'
}
]
};
Expand Down
2 changes: 1 addition & 1 deletion test/prefer-array-find.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const SUGGESTION_LOGICAL_OR_OPERATOR = 'suggest-logical-or-operator';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/prefer-node-append.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import rule from '../rules/prefer-node-append';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-node-remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ruleTester = avaRuleTester(test, {
es6: true
},
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-number-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const methods = {

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-optional-catch-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const generateError = name => ({messageId: ERROR_MESSAGE_ID, data: {name}});

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-set-has.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ruleId = 'prefer-set-has';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/prefer-spread.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import rule from '../rules/prefer-spread';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/prefer-starts-ends-with.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import rule from '../rules/prefer-starts-ends-with';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/prevent-abbreviations.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const browserES5RuleTester = avaRuleTester(test, {

const moduleRuleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2021,
sourceType: 'module'
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/throw-new-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const messageId = 'throw-new-error';

const ruleTester = avaRuleTester(test, {
parserOptions: {
ecmaVersion: 2020
ecmaVersion: 2021
}
});

Expand Down

0 comments on commit a78cea3

Please sign in to comment.