-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
131 lines (130 loc) · 3.9 KB
/
.eslintrc.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
const restrictedGlobals = require('confusing-browser-globals');
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
ignorePatterns: ['coverage', 'www'],
overrides: [
{
files: ['**/*.ts'],
parserOptions: {
project: ['tsconfig.json'],
createDefaultProgram: true,
},
plugins: [
'no-relative-import-paths',
'import',
'simple-import-sort',
'no-loops',
'promise',
'jasmine',
],
extends: [
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:promise/recommended',
'plugin:no-unsanitized/recommended-legacy',
'plugin:regexp/recommended',
'plugin:prettier/recommended',
],
rules: {
'no-extra-boolean-cast': ['error'],
'no-var': ['error'],
'prefer-const': ['error'],
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'app',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
'no-relative-import-paths/no-relative-import-paths': [
'error',
{ allowSameFolder: true },
],
'import/first': 'error',
'import/consistent-type-specifier-style': 'error',
'import/newline-after-import': ['error', { count: 1 }],
'import/no-absolute-path': 'error',
'import/no-relative-packages': 'error',
'import/no-useless-path-segments': [
'error',
{
noUselessIndex: true,
},
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-restricted-globals': ['error'].concat(restrictedGlobals),
'promise/no-multiple-resolved': ['error'],
'regexp/letter-case': [
'error',
{
caseInsensitive: 'lowercase',
unicodeEscape: 'lowercase',
hexadecimalEscape: 'lowercase',
controlEscape: 'uppercase',
},
],
'regexp/no-contradiction-with-assertion': ['error'],
'regexp/no-control-character': ['error'],
'regexp/no-extra-lookaround-assertions': ['error'],
'regexp/no-misleading-capturing-group': ['error'],
'regexp/no-misleading-unicode-character': ['error'],
'regexp/no-missing-g-flag': ['error'],
'regexp/prefer-escape-replacement-dollar-char': ['error'],
'regexp/prefer-named-backreference': ['error'],
'regexp/prefer-named-capture-group': ['error'],
'regexp/prefer-named-replacement': ['error'],
'regexp/prefer-quantifier': ['error'],
'regexp/sort-alternatives': ['error'],
'regexp/sort-character-class-elements': ['error'],
'regexp/use-ignore-case': ['error'],
'no-loops/no-loops': ['error'],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
},
{
files: ['**/*.spec.ts'],
extends: ['plugin:jasmine/recommended', 'plugin:prettier/recommended'],
},
{
files: ['**/*.html'],
extends: [
'plugin:@angular-eslint/template/accessibility',
'plugin:@angular-eslint/template/recommended',
'plugin:prettier/recommended',
],
rules: {},
},
{
files: ['**/*.js'],
parserOptions: {
ecmaVersion: 2021,
},
extends: ['plugin:prettier/recommended'],
rules: {
'sort-imports': ['error'],
},
},
],
};