Skip to content

Commit b2d45b4

Browse files
committed
Updated eslint config
1 parent f71f154 commit b2d45b4

File tree

3 files changed

+45
-16
lines changed

3 files changed

+45
-16
lines changed

.eslintrc.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { defineConfig } from "eslint/config";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import _import from "eslint-plugin-import";
4+
import { fixupPluginRules } from "@eslint/compat";
5+
import globals from "globals";
6+
import tsParser from "@typescript-eslint/parser";
7+
import path from "node:path";
8+
import { fileURLToPath } from "node:url";
9+
import js from "@eslint/js";
10+
import { FlatCompat } from "@eslint/eslintrc";
11+
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
14+
const compat = new FlatCompat({
15+
baseDirectory: __dirname,
16+
recommendedConfig: js.configs.recommended,
17+
allConfig: js.configs.all
18+
});
19+
20+
export default defineConfig([{
21+
extends: compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
22+
23+
plugins: {
24+
"@typescript-eslint": typescriptEslint,
25+
import: fixupPluginRules(_import),
26+
},
27+
28+
languageOptions: {
29+
globals: {
30+
...globals.node,
31+
...globals.sourceType,
32+
},
33+
34+
parser: tsParser,
35+
ecmaVersion: "latest",
36+
sourceType: "module",
37+
},
38+
39+
rules: {
40+
"import/no-duplicates": "error",
41+
},
42+
}]);

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
"lint:fix": "eslint ./workbench/resources/js --ext .ts,.tsx --fix"
88
},
99
"devDependencies": {
10+
"@eslint/compat": "^1.3.0",
11+
"@eslint/js": "^9.29.0",
1012
"@types/node": "^22.7.5",
1113
"@typescript-eslint/eslint-plugin": "^8.34.1",
1214
"@typescript-eslint/parser": "^8.34.1",
1315
"eslint": "^9.29.0",
1416
"eslint-plugin-import": "^2.31.0",
17+
"globals": "^16.2.0",
1518
"happy-dom": "^18.0.1",
1619
"vitest": "^3.2.3"
1720
}

0 commit comments

Comments
 (0)