Skip to content

Commit 796d0e3

Browse files
committed
build: migrate eslint to v9
1 parent 3e7dc46 commit 796d0e3

File tree

5 files changed

+350
-523
lines changed

5 files changed

+350
-523
lines changed

.eslintignore

-7
This file was deleted.

.eslintrc.json

-47
This file was deleted.

eslint.config.mjs

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
3+
import js from "@eslint/js";
4+
import { FlatCompat } from "@eslint/eslintrc";
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
recommendedConfig: js.configs.recommended,
11+
allConfig: js.configs.all
12+
});
13+
14+
export default [{
15+
ignores: [
16+
"**/node_modules",
17+
"**/package-lock.json",
18+
"**/documentation",
19+
"**/e2e",
20+
"src/setupJest.ts",
21+
"src/jestGlobalMocks.ts",
22+
"src/environments",
23+
],
24+
}, {
25+
files: ["**/*.js"],
26+
27+
languageOptions: {
28+
ecmaVersion: 2018,
29+
sourceType: "script",
30+
},
31+
}, ...compat.extends(
32+
"plugin:@angular-eslint/recommended",
33+
"plugin:@typescript-eslint/recommended",
34+
"prettier",
35+
).map(config => ({
36+
...config,
37+
files: ["**/*.ts"],
38+
})), {
39+
files: ["**/*.ts"],
40+
41+
languageOptions: {
42+
ecmaVersion: 5,
43+
sourceType: "script",
44+
45+
parserOptions: {
46+
project: ["tsconfig.*?.json"],
47+
createDefaultProgram: true,
48+
},
49+
},
50+
51+
rules: {
52+
"@angular-eslint/component-class-suffix": ["error", {
53+
suffixes: ["Component", "Page"],
54+
}],
55+
56+
"@angular-eslint/directive-selector": ["error", {
57+
type: "attribute",
58+
prefix: "app",
59+
style: "camelCase",
60+
}],
61+
62+
"@angular-eslint/component-selector": ["error", {
63+
type: "element",
64+
prefix: "app",
65+
style: "kebab-case",
66+
}],
67+
},
68+
}, ...compat.extends("plugin:@angular-eslint/template/recommended").map(config => ({
69+
...config,
70+
files: ["**/*.html"],
71+
})), ...compat.extends("plugin:@angular-eslint/template/process-inline-templates").map(config => ({
72+
...config,
73+
files: ["**/*.component.ts"],
74+
}))];

0 commit comments

Comments
 (0)