-
-
Notifications
You must be signed in to change notification settings - Fork 177
/
.eslintrc.js
190 lines (187 loc) Β· 5.69 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
181
182
183
184
185
186
187
188
189
190
/*
π Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! π
*/
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
'eslint:recommended',
//'plugin:jsdoc/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
/*
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
'prettier/@typescript-eslint',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:unicorn/recommended',
'plugin:jest-dom/recommended',
'plugin:jsx-a11y/recommended',
*/
],
"plugins": [
"eslint-plugin-jsdoc",
"@typescript-eslint"
],
"root": true,
"rules": {
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '.*', // TS already enforces this
args: 'none',
ignoreRestSiblings: true,
},
],
'no-unused-vars': 'off',
'unused-imports/no-unused-vars': 'off',
'no-constant-condition': ['error', { checkLoops: false }],
'no-dupe-class-members': 'off',
'no-redeclare': 'off',
'prefer-rest-params': 'off',
'@typescript-eslint/no-inferrable-types': ['error', { ignoreParameters: true }],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
/*
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": [
"off",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
'@typescript-eslint/naming-convention': [
'off',
{
// Properties and destructured variables often can't be controlled by us if the API is external.
// Event logging, `__typename` etc don't follow conventions enforceable here.
// We also need to allow implementing external interface methods, e.g. UNSAFE_componentWillReceiveProps().
selector: 'default',
format: null,
},
{
// Helps e.g. Go engineers who are used to lowercase unexported types.
selector: 'typeLike',
format: ['PascalCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
],
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": "off",
"@typescript-eslint/semi": [
"off",
null
],
"@typescript-eslint/type-annotation-spacing": "off",
"arrow-parens": [
"off",
"always"
],
"brace-style": [
"off",
"off"
],
"comma-dangle": "off",
"curly": "error",
"eol-last": "off",
"eqeqeq": [
"error",
"smart"
],
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"indent": "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "error",
"jsdoc/newline-after-description": "error",
"linebreak-style": "off",
"max-len": "off",
"new-parens": "off",
"newline-per-chained-call": "off",
"no-empty": "error",
"no-empty-function": "off",
"no-eval": "error",
"no-extra-semi": "off",
"no-irregular-whitespace": "off",
"no-multiple-empty-lines": "off",
"no-redeclare": "error",
"no-trailing-spaces": "off",
"no-underscore-dangle": "off",
"no-unused-expressions": "off",
"no-var": "error",
"one-var": [
"error",
"never"
],
"padded-blocks": [
"off",
{
"blocks": "never"
},
{
"allowSingleLineBlocks": true
}
],
"quote-props": "off",
"quotes": "off",
"semi": "off",
"space-before-function-paren": "off",
"space-in-parens": [
"off",
"never"
],
"spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
]
*/
}
};