Skip to content

Commit

Permalink
Set config ecmaVersion to 2022 (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish authored Nov 4, 2023
1 parent 6ddbc0d commit 8b8ba16
Show file tree
Hide file tree
Showing 94 changed files with 180 additions and 180 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'script',
babelOptions: {
configFile: require.resolve('./.babelrc'),
Expand All @@ -24,7 +24,7 @@ module.exports = {
'prettier',
],
env: {
es2020: true,
es2022: true,
node: true,
jest: true,
},
Expand Down
4 changes: 2 additions & 2 deletions lib/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module.exports = {
root: true,

parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
},

env: {
browser: true,
es2020: true,
es2022: true,
},

plugins: ['ember'],
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules-preprocessor/gjs-gts-parser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function initESLint(parser = gjsGtsParser) {
browser: true,
},
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
},
parser,
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/alias-model-in-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const RuleTester = require('eslint').RuleTester;
// ------------------------------------------------------------------------------

const eslintTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

eslintTester.run('alias-model-in-controller', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/avoid-leaking-state-in-ember-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const RuleTester = require('eslint').RuleTester;

const eslintTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});
eslintTester.run('avoid-leaking-state-in-ember-objects', rule, {
valid: [
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/avoid-using-needs-in-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const RuleTester = require('eslint').RuleTester;
const eslintTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
},
});
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/classic-decorator-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {

const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

ruleTester.run('classic-decorator-hooks', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/classic-decorator-no-classic-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { disallowedMethodErrorMessage } = rule;

const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

ruleTester.run('classic-decorator-no-classic-methods', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/closure-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { ERROR_MESSAGE } = rule;
// ------------------------------------------------------------------------------

const eslintTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

eslintTester.run('closure-actions', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/computed-property-getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { addComputedImport } = require('../../helpers/test-case');

const { PREVENT_GETTER_MESSAGE, ALWAYS_GETTER_MESSAGE, ALWAYS_WITH_SETTER_MESSAGE } = rule;
const ruleTester = new RuleTester();
const parserOptions = { ecmaVersion: 2020, sourceType: 'module' };
const parserOptions = { ecmaVersion: 2022, sourceType: 'module' };
const output = null;

const alwaysWithSetterOptionErrors = [
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/jquery-ember-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const RuleTester = require('eslint').RuleTester;

const { ERROR_MESSAGE } = rule;
const eslintTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

eslintTester.run('jquery-ember-run', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/named-functions-in-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const RuleTester = require('eslint').RuleTester;
// ------------------------------------------------------------------------------

const eslintTester = new RuleTester({
parserOptions: { ecmaVersion: 2020 },
parserOptions: { ecmaVersion: 2022 },
});

eslintTester.run('named-functions-in-promises', rule, {
Expand Down
28 changes: 14 additions & 14 deletions tests/lib/rules/new-module-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ eslintTester.run('new-module-imports', rule, {
const { Handlebars: { Utils: { escapeExpression } } } = Ember
`,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
},
'Ember.Handlebars.Utils.escapeExpression("foo");',
'Ember.onerror = function() {};',
Expand All @@ -31,7 +31,7 @@ eslintTester.run('new-module-imports', rule, {
export default Component.extend({});
`,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
},
{
code: `
Expand All @@ -43,22 +43,22 @@ eslintTester.run('new-module-imports', rule, {
...foo
});
`,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
},
{
code: `import LOL from 'who-knows-but-definitely-not-ember';
const { Controller } = LOL;
`,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
},
{
code: 'export const Ember = 1;',
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
},
{
code: 'for (let i = 0; i < 10; i++) { }',
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
},
'SomethingRandom.Ember.Service;',
],
Expand All @@ -71,7 +71,7 @@ eslintTester.run('new-module-imports', rule, {
export default Component.extend({});
`,
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message:
Expand All @@ -86,7 +86,7 @@ eslintTester.run('new-module-imports', rule, {
const { Controller } = LOL;
`,
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message:
Expand All @@ -103,7 +103,7 @@ eslintTester.run('new-module-imports', rule, {
export default Controller.extend({});
`,
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message: "Use `import $ from 'jquery';` instead of using Ember destructuring",
Expand All @@ -125,7 +125,7 @@ eslintTester.run('new-module-imports', rule, {
export default Component.extend({});
`,
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message:
Expand All @@ -149,7 +149,7 @@ eslintTester.run('new-module-imports', rule, {
});
`,
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message:
Expand Down Expand Up @@ -178,7 +178,7 @@ eslintTester.run('new-module-imports', rule, {
export default Component.extend({});
`,
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message:
Expand All @@ -195,7 +195,7 @@ eslintTester.run('new-module-imports', rule, {
{
code: 'export default Ember.Service;',
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message: "Use `import Service from '@ember/service';` instead of using Ember.Service",
Expand All @@ -206,7 +206,7 @@ eslintTester.run('new-module-imports', rule, {
{
code: 'export default Ember.Service.extend({});',
output: null,
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
errors: [
{
message: "Use `import Service from '@ember/service';` instead of using Ember.Service",
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-actions-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { ERROR_MESSAGE } = rule;

const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});
ruleTester.run('no-actions-hash', rule, {
valid: [
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-array-prototype-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const RuleTester = require('eslint').RuleTester;

const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

ruleTester.run('no-array-prototype-extensions', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-arrow-function-computed-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { ERROR_MESSAGE } = rule;

const ruleTester = new RuleTester({
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { ERROR_MESSAGE } = rule;
const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
babelOptions: {
configFile: require.resolve('../../../.babelrc'),
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-at-ember-render-modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { ERROR_MESSAGE } = rule;

const ruleTester = new RuleTester({
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
},
});
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-attrs-in-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { ERROR_MESSAGE } = rule;
//------------------------------------------------------------------------------

const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
parser: require.resolve('@babel/eslint-parser'),
});

Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-attrs-snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const RuleTester = require('eslint').RuleTester;

const { ERROR_MESSAGE } = rule;
const eslintTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
parser: require.resolve('@babel/eslint-parser'),
});

Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-capital-letters-in-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const RuleTester = require('eslint').RuleTester;
//------------------------------------------------------------------------------

const eslintTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});
eslintTester.run('no-capital-letters-in-routes', rule, {
valid: [
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-classic-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { ERROR_MESSAGE_NO_CLASSIC_CLASSES: ERROR_MESSAGE } = rule;
//------------------------------------------------------------------------------

const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

ruleTester.run('no-classic-classes', rule, {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-classic-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const RuleTester = require('eslint').RuleTester;

const { ERROR_MESSAGE } = rule;
const parserOptions = {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
};
const ruleTester = new RuleTester({ parserOptions });
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-component-lifecycle-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const RuleTester = require('eslint').RuleTester;
const { ERROR_MESSAGE_NO_COMPONENT_LIFECYCLE_HOOKS: ERROR_MESSAGE } = rule;

const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

ruleTester.run('no-component-lifecycle-hooks', rule, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { ERROR_MESSAGE } = rule;
const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: { legacyDecorators: true },
},
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-controller-access-in-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { ERROR_MESSAGE } = rule;
const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
},
});
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { ERROR_MESSAGE } = rule;

const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});
ruleTester.run('no-controllers', rule, {
valid: [
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-current-route-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const RuleTester = require('eslint').RuleTester;
const { ERROR_MESSAGE } = rule;

const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: 'module' },
parserOptions: { ecmaVersion: 2022, sourceType: 'module' },
});

ruleTester.run('no-current-route-name', rule, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { ERROR_MESSAGE } = rule;
const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
ecmaFeatures: { legacyDecorators: true },
},
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/no-deprecated-router-transition-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const RuleTester = require('eslint').RuleTester;
const ruleTester = new RuleTester({
parser: require.resolve('@babel/eslint-parser'),
parserOptions: {
ecmaVersion: 2020,
ecmaVersion: 2022,
sourceType: 'module',
babelOptions: {
configFile: require.resolve('../../../.babelrc'),
Expand Down
Loading

0 comments on commit 8b8ba16

Please sign in to comment.