-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
180 lines (180 loc) · 5.87 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
module.exports = {
root: true,
ignorePatterns: ['projects/**/*'],
overrides: [
{
files: ['src/**/*.spec.ts'],
parserOptions: {
project: './src/tsconfig.spec.json',
},
extends: ['plugin:jasmine/recommended'],
plugins: ['jasmine'],
env: { jasmine: true },
rules: {
'jasmine/new-line-before-expect': 'error',
'jasmine/no-disabled-tests': 'error',
'jasmine/new-line-between-declarations': 'error',
'jasmine/no-spec-dupes': 'error',
'jasmine/no-promise-without-done-fail': 'error',
// We intend to enable these eventually:
'jasmine/no-unsafe-spy': 'off',
'jasmine/prefer-promise-strategies': 'off',
'jasmine/prefer-toHaveBeenCalledWith': 'off',
},
},
{
files: ['*.ts'],
parserOptions: {
project: ['tsconfig.json'],
createDefaultProgram: true,
},
extends: [
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
'airbnb-base',
'airbnb-typescript/base',
'prettier',
'plugin:prettier/recommended',
],
rules: {
'@typescript-eslint/consistent-type-definitions': 'error',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'off',
{
accessibility: 'explicit',
},
],
'brace-style': ['error', '1tbs'],
'id-blacklist': 'off',
'id-match': 'off',
'import/prefer-default-export': 'off',
'import/no-import-module-exports': 'off',
'no-underscore-dangle': 'off',
'max-classes-per-file': 'off',
'no-console': ['error', { allow: ['error'] }],
'import/no-default-export': 'error',
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true },
],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
['internal', 'parent'],
'sibling',
'index',
],
},
],
'@angular-eslint/component-selector': [
'error',
{
prefix: 'pr',
style: 'kebab-case',
type: 'element',
},
],
'@angular-eslint/directive-selector': [
'error',
{
prefix: 'pr',
style: 'camelCase',
type: 'attribute',
},
],
// Below are rules we want to eventually enable:
'import/no-cycle': 'off',
'@angular-eslint/no-output-native': 'off',
'@angular-eslint/no-output-on-prefix': 'off',
'@angular-eslint/use-lifecycle-interface': 'off',
'@typescript-eslint/default-param-last': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/return-await': 'off',
'array-callback-return': 'off',
'brace-style': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'default-case': 'off',
eqeqeq: 'off',
'func-names': 'off',
'global-require': 'off',
'guard-for-in': 'off',
'jsdoc/newline-after-description': 'off',
'new-cap': 'off',
'no-await-in-loop': 'off',
'no-case-declarations': 'off',
'no-constant-condition': 'off',
'no-constructor-return': 'off',
'no-continue': 'off',
'no-control-regex': 'off',
'no-else-return': 'off',
'no-empty': 'off',
'no-lonely-if': 'off',
'no-multi-assign': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-promise-executor-return': 'off',
'no-prototype-builtins': 'off',
'no-restricted-globals': 'off',
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'off',
'no-unneeded-ternary': 'off',
'no-useless-catch': 'off',
'no-useless-concat': 'off',
'no-useless-escape': 'off',
'no-useless-return': 'off',
'no-var': 'off',
'object-shorthand': 'off',
'one-var': 'off',
'operator-assignment': 'off',
'prefer-arrow/prefer-arrow-functions': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'prefer-exponentiation-operator': 'off',
'prefer-object-spread': 'off',
'prefer-promise-reject-errors': 'off',
'prefer-regex-literals': 'off',
'prefer-template': 'off',
radix: 'off',
'spaced-comment': 'off',
'vars-on-top': 'off',
yoda: 'off',
'prettier/prettier': 'off',
},
},
{
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {
// We want to disable these rules eventually:
'@angular-eslint/template/no-negated-async': 'off',
},
},
{
files: ['*.stories.ts', 'src/stories/*.ts'],
rules: {
'import/no-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'@angular-eslint/component-selector': 'off',
'storybook/prefer-pascal-case': 'error',
},
},
],
extends: ['plugin:storybook/recommended'],
};