Skip to content

Commit 32512f9

Browse files
Clinton WerthClinton Werth
authored andcommitted
add eslint config
1 parent 6030daf commit 32512f9

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

web-app/eslint.config.mjs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 [...compat.extends(
15+
"eslint:recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"plugin:@angular-eslint/recommended",
18+
).map(config => ({
19+
...config,
20+
files: ["**/*.ts"],
21+
})), {
22+
files: ["**/*.ts"],
23+
24+
languageOptions: {
25+
ecmaVersion: 5,
26+
sourceType: "script",
27+
28+
parserOptions: {
29+
project: ["tsconfig.app.json", "tsconfig.spec.json"],
30+
createDefaultProgram: true,
31+
},
32+
},
33+
34+
rules: {
35+
"@angular-eslint/directive-selector": ["error", {
36+
type: "attribute",
37+
prefix: "app",
38+
style: "camelCase",
39+
}],
40+
41+
"@angular-eslint/component-selector": ["error", {
42+
type: "element",
43+
prefix: "app",
44+
style: "kebab-case",
45+
}],
46+
},
47+
}, ...compat.extends("plugin:@angular-eslint/template/recommended").map(config => ({
48+
...config,
49+
files: ["**/*.html"],
50+
})), {
51+
files: ["**/*.html"],
52+
rules: {},
53+
}];

0 commit comments

Comments
 (0)