Skip to content

Commit

Permalink
chore(lint): migrate eslint config to the new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
BobrImperator committed Jul 6, 2024
1 parent 9de710c commit 6e20151
Show file tree
Hide file tree
Showing 7 changed files with 249 additions and 97 deletions.
43 changes: 0 additions & 43 deletions packages/ember-cookies/.eslintrc.js

This file was deleted.

77 changes: 77 additions & 0 deletions packages/ember-cookies/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import ember from 'eslint-plugin-ember';
import prettier from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import n from 'eslint-plugin-n';
import js from '@eslint/js';

export default [
js.configs.recommended,
prettier,
{
ignores: [
'node-tests/fixtures/',
'blueprints/*/files/',
'vendor/',
'dist/',
'tmp/',
'bower_components/',
'node_modules/',
'coverage/',
'!**/.*',
'.node_modules.ember-try/',
'bower.json.ember-try',
'package.json.ember-try',
],
},
{
plugins: {
ember,
},

languageOptions: {
globals: {
...globals.browser,
},

parser: babelParser,
ecmaVersion: 2020,
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
legacyDecorators: true,
},
},
},

rules: {},
},
{
files: [
'**/.babelrc.js',
'**/.eslintrc.js',
'**/.eslintrc.js',
'**/.prettierrc.js',
'**/addon-main.js',
'blueprints/*/index.js',
'config/**/*.js',
],

ignores: ['src/**'],

plugins: {
n,
},

languageOptions: {
globals: {
...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])),
...globals.node,
},

ecmaVersion: 6,
sourceType: 'script',
},
},
];
3 changes: 3 additions & 0 deletions packages/ember-cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.24.0",
"@embroider/addon-dev": "4.2.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.6.0",
"@rollup/plugin-babel": "6.0.4",
"@types/ember": "4.0.11",
"concurrently": "8.2.2",
Expand All @@ -68,6 +70,7 @@
"eslint-plugin-ember": "12.0.2",
"eslint-plugin-n": "14.0.0",
"eslint-plugin-prettier": "5.1.3",
"globals": "^15.8.0",
"prettier": "3.2.5",
"rollup": "2.79.1"
},
Expand Down
54 changes: 0 additions & 54 deletions packages/test-app/.eslintrc.js

This file was deleted.

88 changes: 88 additions & 0 deletions packages/test-app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import ember from 'eslint-plugin-ember';
import prettier from 'eslint-plugin-prettier/recommended';
import qunit from 'eslint-plugin-qunit';
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import n from 'eslint-plugin-n';
import js from '@eslint/js';

export default [
js.configs.recommended,
prettier,
{
ignores: [
'node-tests/fixtures/',
'blueprints/*/files/',
'vendor/',
'dist/',
'tmp/',
'bower_components/',
'node_modules/',
'coverage/',
'!**/.*',
'.node_modules.ember-try/',
'bower.json.ember-try',
'package.json.ember-try',
],
},
{
plugins: {
ember,
},

languageOptions: {
globals: {
...globals.browser,
},

parser: babelParser,
ecmaVersion: 2020,
sourceType: 'module',

parserOptions: {
ecmaFeatures: {
legacyDecorators: true,
},
},
},

rules: {
'ember/no-classic-classes': 'off',
},
},
{
files: [
'**/.babelrc.js',
'**/.eslintrc.js',
'**/.eslintrc.js',
'**/.prettierrc.js',
'**/addon-main.js',
'**/ember-try.js',
'**/ember-cli-build.js',
'**/testem.js',
'blueprints/*/index.js',
'config/**/*.js',
],

ignores: ['src/**'],

plugins: {
n,
},

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 6,
sourceType: 'script',
},
},
{
plugins: {
qunit,
},
files: ['tests/**/*-test.js'],
},
];
3 changes: 3 additions & 0 deletions packages/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@ember/string": "3.1.1",
"@ember/test-helpers": "3.3.0",
"@embroider/test-setup": "3.0.3",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.6.0",
"@glimmer/component": "1.1.2",
"@glimmer/tracking": "1.1.2",
"broccoli-asset-rev": "3.0.0",
Expand Down Expand Up @@ -59,6 +61,7 @@
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-qunit": "8.1.1",
"glob": "10.3.10",
"globals": "^15.8.0",
"loader.js": "4.7.0",
"prettier": "3.2.5",
"qunit": "2.20.1",
Expand Down
Loading

0 comments on commit 6e20151

Please sign in to comment.