-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy patheslint.config.js
86 lines (83 loc) · 3.02 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
// @ts-check
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const angular = require('angular-eslint');
module.exports = tseslint.config(
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...angular.configs.tsRecommended,
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
},
processor: angular.processInlineTemplates,
rules: {
'@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',
},
],
// 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 'rea' errors are too hard to spot when
// every file is full of errors.
'@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: {},
}
);