Skip to content

Commit

Permalink
Merge pull request #246 from DazzlingFugu/upgrade-to-eslint-v9
Browse files Browse the repository at this point in the history
Upgrade ESLint from v8 to v9
  • Loading branch information
MrChocolatine authored Nov 29, 2024
2 parents 98e7771 + 63cfa1d commit cd7a4f4
Show file tree
Hide file tree
Showing 8 changed files with 354 additions and 416 deletions.
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

56 changes: 0 additions & 56 deletions .eslintrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.github/
/.gitignore
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = {
overrides: [
{
files: '*.{js,ts}',
files: '*.{js,mjs,ts}',
options: {
singleQuote: true,
},
Expand Down
2 changes: 1 addition & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ module.exports = function (defaults) {
},
},
},
/* eslint-disable prettier/prettier */
/* eslint-enable prettier/prettier */
});
};
109 changes: 109 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import ember from 'eslint-plugin-ember';
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import js from '@eslint/js';

import pluginEmberRecommended from 'eslint-plugin-ember/configs/recommended';
import pluginNode from 'eslint-plugin-n';
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import pluginQunitRecommended from 'eslint-plugin-qunit/configs/recommended';

export default [
js.configs.recommended,
...pluginEmberRecommended,
pluginPrettierRecommended,

{
ignores: [
// Unconventional js
'blueprints/*/files/',

// Compiled output
'declarations/',
'dist/',

// Misc
'coverage/',
'!**/.*',
'**/.*/',

// ember-try
'.node_modules.ember-try/',
],
},
{
plugins: {
ember,
},

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

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

parserOptions: {
requireConfigFile: false,

babelOptions: {
plugins: [
[
'@babel/plugin-proposal-decorators',
{
decoratorsBeforeExport: true,
},
],
],
},
},
},

rules: {},
},
{
...pluginNode.configs['flat/recommended-script'],
files: [
'.prettierrc.js',
'.stylelintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js',
],
},
{
files: [
'.prettierrc.js',
'.stylelintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js',
],

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

ecmaVersion: 5,
sourceType: 'script',
},
},
{
...pluginQunitRecommended,
files: ['tests/**/*-test.{js,ts}'],
},
];
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"@ember/string": "^4.0.0",
"@ember/test-helpers": "^4.0.4",
"@embroider/test-setup": "^3.0.3",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
Expand All @@ -84,12 +86,13 @@
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.13.0",
"ember-try": "^3.0.0",
"eslint": "^8.57.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.2.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-ember": "^12.3.3",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-qunit": "^8.1.1",
"globals": "^15.12.0",
"loader.js": "^4.7.0",
"prettier": "^3.2.5",
"qunit": "^2.20.1",
Expand Down
Loading

0 comments on commit cd7a4f4

Please sign in to comment.