-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
111 lines (110 loc) · 3.9 KB
/
eslint.config.mjs
File metadata and controls
111 lines (110 loc) · 3.9 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
99
100
101
102
103
104
105
106
107
108
109
110
111
import eslintJs from '@eslint/js';
import { configs as angularConfigs, processInlineTemplates } from 'angular-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
import { defineConfig } from 'eslint/config';
import { configs as tsConfigs } from 'typescript-eslint';
const { configs: jsConfigs } = eslintJs;
export default defineConfig([
{
files: ['**/*.ts'],
ignores: ['**/src/app/spartan/**'],
plugins: {
'unused-imports': unusedImports,
},
extends: [jsConfigs.recommended, tsConfigs.recommended, tsConfigs.stylistic, angularConfigs.tsRecommended],
processor: processInlineTemplates,
rules: {
complexity: ['warn', 16],
quotes: ['warn', 'single', { allowTemplateLiterals: true }],
semi: ['warn', 'always'],
'max-statements-per-line': ['warn', { max: 1 }],
'max-params': ['warn', 4],
'max-depth': ['warn', 4],
'max-lines': ['warn', 500],
'max-len': [
'warn',
{
code: 125,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'unused-imports/no-unused-imports': 'error',
'object-shorthand': ['warn', 'always', { avoidQuotes: true }],
'quote-props': ['warn', 'consistent-as-needed'],
'@angular-eslint/prefer-on-push-component-change-detection': ['error'],
'@angular-eslint/use-injectable-provided-in': ['error'],
'@angular-eslint/no-lifecycle-call': ['error'],
'@angular-eslint/prefer-signals': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
},
],
'@typescript-eslint/no-empty-function': [
'error',
{
allow: [
'constructors',
'methods',
'arrowFunctions',
'private-constructors',
'protected-constructors',
'overrideMethods',
'decoratedFunctions',
],
},
],
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{
group: ['rxjs/operators'],
message: "Don't use 'rxjs/operators' instead of 'rxjs'",
},
],
},
],
'@angular-eslint/component-selector': ['error', { type: 'element', prefix: 'adm', style: 'kebab-case' }],
'@angular-eslint/no-implicit-take-until-destroyed': 'error',
'@angular-eslint/prefer-signal-model': 'error',
'@angular-eslint/prefer-host-metadata-property': ['error'],
'@angular-eslint/prefer-output-readonly': ['error'],
'@angular-eslint/prefer-output-emitter-ref': ['error'],
// Needed to be off because spartan uses input renaming frequently
'@angular-eslint/no-input-rename': ['off'],
},
},
{
files: ['**/*.html'],
ignores: ['**/src/app/spartan/**'],
extends: [angularConfigs.templateRecommended, angularConfigs.templateAccessibility],
rules: {
'@angular-eslint/template/prefer-self-closing-tags': ['warn'],
'@angular-eslint/template/prefer-class-binding': 'error',
'@angular-eslint/template/prefer-ngsrc': ['warn'],
'@angular-eslint/template/attributes-order': ['error'],
'@angular-eslint/template/button-has-type': ['error'],
'@angular-eslint/template/no-duplicate-attributes': ['error'],
'@angular-eslint/template/no-inline-styles': ['warn'],
'@angular-eslint/template/no-interpolation-in-attributes': ['error'],
'@angular-eslint/template/no-positive-tabindex': ['error'],
},
},
]);