Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
es6: true,
},
parserOptions: {
ecmaVersion: 2021,
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"devDependencies": {
"@babel/code-frame": "^7.14.5",
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.4",
"@babel/eslint-parser": "^7.15.7",
"@lubien/fixture-beta-package": "^1.0.0-beta.1",
"@typescript-eslint/parser": "^4.31.0",
"@typescript-eslint/parser": "^4.32.0",
"ava": "^3.15.0",
"chalk": "^4.1.2",
"enquirer": "2.3.6",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Configure it in `package.json`.
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
Expand Down
2 changes: 0 additions & 2 deletions test/consistent-function-scoping.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const createError = (functionNameWithKind, loc) => ({
test({
testerOptions: {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021,
ecmaFeatures: {
jsx: true,
},
Expand Down
4 changes: 0 additions & 4 deletions test/integration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2021,
ecmaFeatures: {
jsx: true,
},
requireConfigFile: false,
babelOptions: {
babelrc: false,
Expand Down
4 changes: 2 additions & 2 deletions test/integration/projects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default [
// 'build/**'
// ]
// },
'https://github.com/ElemeFE/element',
'https://github.com/iview/iview',
// 'https://github.com/ElemeFE/element',
// 'https://github.com/iview/iview',
'https://github.com/sindresorhus/create-dmg',
'https://github.com/sindresorhus/cp-file',
'https://github.com/sindresorhus/capture-website',
Expand Down
1 change: 1 addition & 0 deletions test/no-for-loop.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ test({
test(avoidTestTitleConflict({
testerOptions: {
parserOptions: {
sourceType: 'script',
ecmaVersion: 5,
},
},
Expand Down
2 changes: 0 additions & 2 deletions test/no-keyword-prefix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,10 @@ test({
},
{
code: 'function foo({ newBar = \'default value\' }) {};',
parserOptions: {ecmaVersion: 6},
errors: [errorNew],
},
{
code: 'const newFoo = 0; function foo({ newBar = newFoo}) {}',
parserOptions: {ecmaVersion: 6},
errors: [errorNew, errorNew],
},
{
Expand Down
1 change: 1 addition & 0 deletions test/prevent-abbreviations.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ test.typescript(avoidTestTitleConflict(tests, 'typescript'));
test({
testerOptions: {
parserOptions: {
sourceType: 'script',
ecmaVersion: 5,
},
env: {
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/eslint-remote-tester.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
Expand Down
10 changes: 9 additions & 1 deletion test/utils/parsers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,18 @@ const vue = {
return require.resolve(this.name);
},
mergeParserOptions(options) {
return {
options = {
...defaultParserOptions,
...options,
};

// The `espree` version in `vue-eslint-parser` does not understand `'latest'` yet.
// https://github.com/vuejs/vue-eslint-parser/pull/113
if (options.ecmaVersion === 'latest') {
options.ecmaVersion = require('espree').latestEcmaVersion;
}

return options;
},
};

Expand Down
7 changes: 5 additions & 2 deletions test/utils/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ class Tester {
}

runTest(tests) {
const {beforeAll, testerOptions, valid, invalid} = tests;
const {beforeAll, testerOptions = {}, valid, invalid} = tests;
const tester = avaRuleTester(test, {
parserOptions: defaultParserOptions,
...testerOptions,
parserOptions: {
...defaultParserOptions,
...testerOptions.parserOptions,
},
});

if (beforeAll) {
Expand Down