-
-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy patheslint.config.mjs
More file actions
93 lines (88 loc) · 3.24 KB
/
eslint.config.mjs
File metadata and controls
93 lines (88 loc) · 3.24 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
// @ts-check
import eslint from '@eslint/js';
import angular from 'angular-eslint';
import prettier from 'eslint-config-prettier/flat';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
export default defineConfig(
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...angular.configs.tsRecommended,
prettier,
],
languageOptions: {
parserOptions: {
projectService: true,
},
},
processor: angular.processInlineTemplates,
rules: {
// Block for overrides that ENABLE non-default rules.
eqeqeq: ['error'], // prefer '===' over '=='
// End of overrides that ENABLE non-default rules.
// Block for overrides that DISABLE default rules.
// This is used for rules that cause too many linter errors in the current
// codebase. If a higher degree of safety is desired, these will have to
// be enabled step by step again when most of the errors are fixed.
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/prefer-nullish-coalescing': ['off'],
// End of overrides that DISABLE default rules
// Block for overrides that DOWNGRADE default rules to warnings.
// This is used for linter errors that are stylistic issues and that are
// (mostly) easily fixable, which is why we want to see them. Yet we don't
// want to see them as errors, as 'real' errors are too hard to spot when
// every file is full of errors.
'@angular-eslint/directive-selector': [
'warn', // downgrade to warning for Beanconqueror
{
type: 'attribute',
prefix: 'app',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'warn', // downgrade to warning for Beanconqueror
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
'@angular-eslint/component-class-suffix': ['warn'],
'@typescript-eslint/array-type': ['warn'],
'@typescript-eslint/dot-notation': ['warn'],
'@typescript-eslint/no-inferrable-types': ['warn'],
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/prefer-includes': ['warn'],
'@typescript-eslint/prefer-optional-chain': ['warn'],
'@typescript-eslint/require-await': ['warn'],
// End of overrides that DOWNGRADE default rules to warnings
// Block for overrides that CHANGE the OPTIONS of default rules
// End of overrides that CHANGE the OPTIONS of default rules
},
},
{
files: ['**/*.spec.ts'],
rules: {
// jasmine assertions return lots of floating promises, which is fine
// in test code
'@typescript-eslint/no-floating-promises': ['off'],
},
},
{
files: ['**/*.html'],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
},
);