Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ESLint to 9.x #207

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

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

This file was deleted.

112 changes: 112 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import ember from "eslint-plugin-ember";
import globals from "globals";
import babelParser from "@babel/eslint-parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
"blueprints/*/files/",
"declarations/",
"dist/",
"coverage/",
"!**/.*",
"**/.*/",
".node_modules.ember-try/",
],
},
...compat.extends(
"eslint:recommended",
"plugin:ember/recommended",
"plugin:prettier/recommended",
),
{
plugins: {
ember,
},

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

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

parserOptions: {
requireConfigFile: false,

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

rules: {},
},
...compat.extends("plugin:n/recommended").map((config) => ({
...config,

files: [
"./.eslintrc.js",
"./.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: [
"./.eslintrc.js",
"./.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: "commonjs",
},
},
...compat.extends("plugin:qunit/recommended").map((config) => ({
...config,
files: ["tests/**/*-test.{js,ts}"],
})),
];
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.13.0",
"ember-try": "^3.0.0",
"eslint": "^8.57.0",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^11.12.0",
"eslint-plugin-n": "^16.6.2",
Expand All @@ -100,6 +100,9 @@
},
"peerDependencies": {
"ember-source": ">= 4.0.0"
},
"resolutions": {
"globals": "^15.8.0"
},
"engines": {
"node": ">= 18"
Expand Down
Loading
Loading