-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy patheslint.config.mjs
More file actions
98 lines (96 loc) · 3.45 KB
/
eslint.config.mjs
File metadata and controls
98 lines (96 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import angular from "angular-eslint";
export default tseslint.config(
{
linterOptions: {
reportUnusedDisableDirectives: "warn",
},
},
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
// Off — not applicable to this codebase
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",
"@angular-eslint/no-empty-lifecycle-method": "off",
"@angular-eslint/directive-selector": "off",
"@angular-eslint/component-selector": "off",
// Warn — migration-period rules to fix over time
// Ignore underscore-prefixed params (intentionally unused) and common
// single-letter callback/catch params that are positional placeholders.
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"@typescript-eslint/no-wrapper-object-types": "warn",
"@typescript-eslint/no-empty-object-type": "warn",
"@angular-eslint/prefer-inject": "warn",
"@angular-eslint/prefer-standalone": "warn",
"@angular-eslint/no-input-rename": "warn",
"@angular-eslint/no-output-native": "warn",
"@angular-eslint/no-output-on-prefix": "warn",
"no-case-declarations": "warn",
"no-extra-boolean-cast": "warn",
"no-prototype-builtins": "warn",
"no-useless-escape": "warn",
"no-empty": "warn",
"no-unexpected-multiline": "warn",
"no-var": "warn",
"no-constant-condition": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-duplicate-enum-values": "warn",
"prefer-const": "warn",
"no-irregular-whitespace": "warn",
"no-duplicate-case": "warn",
"@typescript-eslint/no-unsafe-function-type": "warn",
},
},
{
files: ["**/*.spec.ts", "**/test-setup.ts"],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{
varsIgnorePattern: "^(describe|it|test|expect|beforeAll|afterAll|beforeEach|afterEach|vi|fixture|component|provideZonelessChangeDetection|_\\w*)$",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},
{
files: ["**/*.html"],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {
// Warn — migration-period rules to fix over time
"@angular-eslint/template/no-negated-async": "warn",
"@angular-eslint/template/eqeqeq": "warn",
"@angular-eslint/template/prefer-control-flow": "warn",
"@angular-eslint/template/interactive-supports-focus": "warn",
"@angular-eslint/template/click-events-have-key-events": "warn",
"@angular-eslint/template/alt-text": "warn",
"@angular-eslint/template/label-has-associated-control": "warn",
"@angular-eslint/template/elements-content": "warn",
},
}
);