-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
147 lines (144 loc) · 4.36 KB
/
eslint.config.js
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// @ts-check
const eslint = require('@eslint/js');
const tsEslint = require('typescript-eslint');
const ngEslint = require('angular-eslint');
const prettierEslintRecommended = require('eslint-plugin-prettier/recommended');
const importX = require('eslint-plugin-import-x');
module.exports = tsEslint.config(
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tsEslint.configs.recommended,
...tsEslint.configs.stylistic,
...ngEslint.configs.tsRecommended,
prettierEslintRecommended
],
processor: ngEslint.processInlineTemplates,
plugins: {
'import-x': importX,
},
rules: {
'@angular-eslint/no-async-lifecycle-method': 'error',
'@angular-eslint/no-attribute-decorator': 'error',
'@angular-eslint/sort-lifecycle-methods': 'warn',
'@angular-eslint/component-max-inline-declarations': [
'error',
{
'template': 1,
'styles': 1,
'animations': 1
}
],
'@angular-eslint/consistent-component-styles': 'error',
'@angular-eslint/contextual-decorator': 'error',
'@angular-eslint/no-conflicting-lifecycle': 'error',
'@angular-eslint/no-forward-ref': 'error',
'@angular-eslint/no-lifecycle-call': 'error',
'@angular-eslint/no-pipe-impure': 'error',
'@angular-eslint/no-queries-metadata-property': 'error',
'@angular-eslint/prefer-on-push-component-change-detection': 'error',
'@angular-eslint/prefer-output-readonly': 'error',
'@angular-eslint/prefer-standalone': 'error',
'@angular-eslint/relative-url-prefix': 'error',
'@angular-eslint/use-lifecycle-interface': 'error',
'@angular-eslint/use-pipe-transform-interface': 'error',
'@angular-eslint/directive-class-suffix': [
'error',
{
'suffixes': ['Directive', 'Component']
}
],
'@angular-eslint/component-class-suffix': [
'error',
{
'suffixes': ['Component']
}
],
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true,
"allowConciseArrowFunctionExpressionsStartingWithVoid": true
}
],
"@typescript-eslint/no-inferrable-types": "error",
"import-x/no-empty-named-blocks": "error",
"import-x/no-duplicates": "error",
"import-x/no-unused-modules": "error",
"import-x/no-unassigned-import": "error",
"import-x/exports-last": "error",
"import-x/first": "error",
"import-x/newline-after-import": "error",
"import-x/order": [
"error",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": false
},
"newlines-between": "always",
"groups": [
"builtin",
"external",
"internal",
"parent",
[
"sibling",
"index"
]
],
"pathGroups": [
{
"pattern": "@angular/**",
"group": "external",
"position": "before"
},
{
"pattern": "{rxjs,rxjs/**}",
"group": "external",
"position": "before"
},
{
"pattern": "@ngrx/**",
"group": "external",
"position": "before"
},
{
"pattern": "{#api,#core/**,#assets/**,#env/**,#app/**,#routing,#root,#store/**}",
"group": "internal",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": []
}
],
"no-bitwise": "error",
"no-irregular-whitespace": "error",
"no-multiple-empty-lines": "error",
"no-redeclare": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"prefer-object-spread": "error",
"prefer-template": "error"
},
},
{
files: ['**/*.html'],
extends: [
...ngEslint.configs.templateRecommended,
...ngEslint.configs.templateAccessibility,
prettierEslintRecommended,
],
rules: {
'prettier/prettier': [
'error',
{
'parser': 'angular'
}
]
}
}
)