Skip to content

Commit e342c0e

Browse files
Migrate to ESLint flat config (#1784)
* Migrate to ESLint flat config * Updates from editor Fix package-lock.json by installing 8.3.0 and copying result over. --------- Co-authored-by: Nathan Shively-Sanders <[email protected]>
1 parent 8318428 commit e342c0e

File tree

3 files changed

+131
-29
lines changed

3 files changed

+131
-29
lines changed

Diff for: eslint.config.mjs

+9-26
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,20 @@
1-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
1+
// @ts-check
2+
3+
import typescriptEslint from "typescript-eslint";
24
import globals from "globals";
3-
import tsParser from "@typescript-eslint/parser";
4-
import path from "node:path";
5-
import { fileURLToPath } from "node:url";
65
import js from "@eslint/js";
7-
import { FlatCompat } from "@eslint/eslintrc";
8-
9-
const __filename = fileURLToPath(import.meta.url);
10-
const __dirname = path.dirname(__filename);
11-
const compat = new FlatCompat({
12-
baseDirectory: __dirname,
13-
recommendedConfig: js.configs.recommended,
14-
allConfig: js.configs.all,
15-
});
6+
import prettierRecommended from "eslint-plugin-prettier/recommended";
167

17-
export default [
18-
...compat.extends(
19-
"eslint:recommended",
20-
"plugin:@typescript-eslint/recommended",
21-
"plugin:prettier/recommended",
22-
),
8+
export default typescriptEslint.config(
9+
js.configs.recommended,
10+
...typescriptEslint.configs.recommended,
11+
prettierRecommended,
2312
{
24-
plugins: {
25-
"@typescript-eslint": typescriptEslint,
26-
},
27-
2813
languageOptions: {
2914
globals: {
3015
...globals.node,
3116
...globals.browser,
3217
},
33-
34-
parser: tsParser,
3518
},
3619

3720
rules: {
@@ -41,4 +24,4 @@ export default [
4124
"@typescript-eslint/no-var-requires": 0,
4225
},
4326
},
44-
];
27+
);

Diff for: package-lock.json

+119-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"license": "Apache-2.0",
3838
"type": "module",
3939
"devDependencies": {
40+
"@eslint/js": "^9",
4041
"@mdn/browser-compat-data": "^5.5.21",
4142
"@octokit/rest": "^21.0.0",
4243
"@types/node": "^22.2.0",
@@ -54,11 +55,13 @@
5455
"eslint": "^9.9.0",
5556
"eslint-config-prettier": "^9.1.0",
5657
"eslint-plugin-prettier": "^5.1.3",
58+
"globals": "^15.9.0",
5759
"jsonc-parser": "^3.2.1",
5860
"node-fetch": "^3.3.2",
5961
"prettier": "^3.2.5",
6062
"print-diff": "^2.0.0",
6163
"typescript": "^5.6.0-dev.20240806",
64+
"typescript-eslint": "^8",
6265
"webidl2": "^24.4.1"
6366
},
6467
"overrides": {

0 commit comments

Comments
 (0)