/
.eslintrc.json
96 lines (96 loc) · 2.9 KB
/
.eslintrc.json
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
{
"root": true,
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.eslint.json"
]
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:rxjs/recommended"
],
"rules": {
"quotes": "off",
"@typescript-eslint/quotes": [
"warn",
"double",
{
"allowTemplateLiterals": true
}
],
// Enforce modern JavaScript
"prefer-template": "error",
"prefer-arrow-callback": "error",
// Stricter JavaScript
"no-new-native-nonconstructor": "error",
"no-constant-binary-expression": "error",
"prefer-object-has-own": "error", // ES2022+
// Strict types
"eqeqeq": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/no-extraneous-class": [
"error",
{
"allowWithDecorator": true
}
],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
"allowNumber": true
}
],
"@angular-eslint/contextual-decorator": "error",
"@angular-eslint/no-attribute-decorator": "error",
"@angular-eslint/no-forward-ref": "error",
"@angular-eslint/no-input-prefix": "error",
"@angular-eslint/no-lifecycle-call": "error",
"@angular-eslint/no-pipe-impure": "error",
"@angular-eslint/no-queries-metadata-property": "error",
"@angular-eslint/use-component-view-encapsulation": "error",
"@angular-eslint/use-injectable-provided-in": "error",
"@angular-eslint/no-async-lifecycle-method": "error",
// Stricter RxJS
"rxjs/no-exposed-subjects": "error",
"rxjs/no-subclass": "error",
"rxjs/no-subject-value": "error",
"rxjs/no-topromise": "error",
"rxjs/no-unsafe-catch": "error",
"rxjs/no-unsafe-first": "error",
"rxjs/no-unsafe-switchmap": "error",
"rxjs/throw-error": "error",
// Disabled because it breaks the lint
"rxjs/no-implicit-any-catch": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/all"
],
"rules": {
"@angular-eslint/template/i18n": "off",
"@angular-eslint/template/no-any": "error"
}
}
]
}