Skip to content

Commit 931b9ed

Browse files
committed
simplified eslint config
1 parent b2d45b4 commit 931b9ed

File tree

2 files changed

+12
-44
lines changed

2 files changed

+12
-44
lines changed

eslint.config.mjs

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,13 @@
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";
91
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,
2+
import tseslint from "typescript-eslint";
3+
4+
export default tseslint.config(
5+
js.configs.recommended,
6+
...tseslint.configs.recommended,
7+
{
8+
files: ["workbench/resources/js/**/*.{ts,tsx}"],
9+
rules: {
10+
"no-duplicate-imports": "error",
3211
},
33-
34-
parser: tsParser,
35-
ecmaVersion: "latest",
36-
sourceType: "module",
37-
},
38-
39-
rules: {
40-
"import/no-duplicates": "error",
4112
},
42-
}]);
13+
);

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
"lint:fix": "eslint ./workbench/resources/js --ext .ts,.tsx --fix"
88
},
99
"devDependencies": {
10-
"@eslint/compat": "^1.3.0",
1110
"@eslint/js": "^9.29.0",
1211
"@types/node": "^22.7.5",
13-
"@typescript-eslint/eslint-plugin": "^8.34.1",
14-
"@typescript-eslint/parser": "^8.34.1",
1512
"eslint": "^9.29.0",
16-
"eslint-plugin-import": "^2.31.0",
17-
"globals": "^16.2.0",
1813
"happy-dom": "^18.0.1",
14+
"typescript-eslint": "^8.34.1",
15+
"vite": "^7.1.3",
1916
"vitest": "^3.2.3"
2017
}
2118
}

0 commit comments

Comments
 (0)