-
Notifications
You must be signed in to change notification settings - Fork 30
/
.eslintrc.yml
240 lines (212 loc) · 6.72 KB
/
.eslintrc.yml
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
extends:
- eslint:recommended
- plugin:eslint-comments/recommended
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2017
sourceType: module
jsx: true
plugins:
- '@typescript-eslint'
- eslint-comments
- import
- jest
settings:
import/resolver:
node:
extensions:
- .js
- .jsx
- .ts
- .tsx
import/parsers:
typescript-eslint-parser:
- .ts
- .tsx
env:
es6: true
rules:
# http://eslint.org/docs/rules/
# Possible Errors
for-direction: error
getter-return: error
no-prototype-builtins: error
no-undef: off # enforced by TypeScript
no-unused-vars: off # enforced by TypeScript
no-redeclare: off # enforced by TypeScript
# Best Practices
class-methods-use-this: error
curly: [error, multi-line]
dot-location: [error, property]
eqeqeq: [error, allow-null]
no-eval: error
no-extend-native: error
no-floating-decimal: error
no-implied-eval: error
no-labels: error
no-lone-blocks: error
no-new-func: error
no-new-wrappers: error
no-octal-escape: error
no-proto: error
no-return-await: error
no-self-compare: error
no-sequences: error
no-unmodified-loop-condition: error
no-unused-expressions: error
no-useless-call: error
no-useless-concat: error
no-useless-return: error
no-void: error
no-with: error
radix: [error, as-needed]
wrap-iife: [error, outside]
yoda: error
# Variables
no-catch-shadow: error
no-label-var: error
no-shadow: error
no-shadow-restricted-names: error
no-undef-init: error
# Node.js and CommonJS
handle-callback-err: [error, "^.*(e|E)rr(or)?"]
no-mixed-requires: error
no-new-require: error
no-path-concat: error
# Stylistic Issues
array-bracket-spacing: error
block-spacing: error
brace-style: [error, 1tbs]
camelcase: error
comma-dangle: [error, {
arrays: always-multiline,
objects: always-multiline,
imports: always-multiline,
exports: always-multiline,
functions: only-multiline,
}]
comma-spacing: error
comma-style: error
computed-property-spacing: error
eol-last: error
func-call-spacing: error
func-names: [error, as-needed]
func-style: [error, declaration, { allowArrowFunctions: true }]
id-blacklist: [error, e, err, cb, fn]
indent: [error, 2, { SwitchCase: 1 }]
jsx-quotes: [error, prefer-single]
key-spacing: [error, { mode: minimum }]
keyword-spacing: error
linebreak-style: error
lines-between-class-members: [error, always, { exceptAfterSingleLine: true }]
max-len: [error, { code: 140, comments: 80, tabWidth: 2, ignoreUrls: true }]
new-cap: error
newline-per-chained-call: [error, { ignoreChainWithDepth: 3 }]
no-array-constructor: error
no-bitwise: error
no-lonely-if: error
no-mixed-operators: error
no-multiple-empty-lines: [error, { max: 1 }]
no-new-object: error
no-tabs: error
no-trailing-spaces: error
no-unneeded-ternary: error
no-whitespace-before-property: error
nonblock-statement-body-position: error
object-curly-newline: [error, { consistent: true }]
object-curly-spacing: [error, always]
operator-assignment: error
operator-linebreak: [error, before, { overrides: { '&&': after, '||': after } }]
quotes: [error, single, { allowTemplateLiterals: true }]
semi: error
semi-spacing: error
semi-style: error
space-before-blocks: [error, always]
space-before-function-paren: [error, never]
space-in-parens: error
# Until https://github.com/eslint/typescript-eslint-parser/issues/449
# space-infix-ops: [error, { int32Hint: true }]
space-unary-ops: [error, { words: true, nonwords: false }]
spaced-comment: error
switch-colon-spacing: error
template-tag-spacing: error
unicode-bom: error
# ES2015+
arrow-parens: [error, as-needed, { requireForBlockBody: true }]
arrow-spacing: error
generator-star-spacing: error
no-confusing-arrow: error
no-dupe-class-members: off # Enforced by TypeScript
no-var: error
object-shorthand: error
prefer-arrow-callback: [error, { allowNamedFunctions: true }]
prefer-const: error
prefer-destructuring: [error, { array: false }]
prefer-numeric-literals: error
prefer-rest-params: error
prefer-spread: error
prefer-template: error
rest-spread-spacing: error
symbol-description: error
template-curly-spacing: error
yield-star-spacing: error
# https://github.com/benmosher/eslint-plugin-import#rules
# Static Analysis:
import/no-unresolved: [error, { caseSensitive: true, commonjs: true, amd: true }]
# TODO: Figure out why some types aren't being treated as exports
# import/named: error
import/default: error
import/namespace: error
import/no-absolute-path: error
import/no-dynamic-require: error
import/no-self-import: error
# Helpful Warnings
# TODO: Until it has TypeScript support…
# import/export: error
import/no-deprecated: error
import/no-extraneous-dependencies: [error, { devDependencies: false }]
import/no-mutable-exports: error
import/no-useless-path-segments: error
# Module Systems
import/no-commonjs: error
import/no-amd: error
import/no-nodejs-modules: error
# Style Guide
# TODO: Until `import name = require('thing');` is supported
# import/first: error
import/no-duplicates: error
import/extensions: [error, never]
import/order: [error, {
groups: [[builtin, external], [internal], [parent], [sibling, index]],
newlines-between: always,
}]
import/no-default-export: error
# https://github.com/nzakas/eslint-plugin-typescript#supported-rules
'@typescript-eslint/adjacent-overload-signatures': error
'@typescript-eslint/member-delimiter-style': [error, {
overrides: {
typeLiteral: {
multiline: { delimiter: comma, requireLast: true },
singleline: { delimiter: comma, requireLast: false }
}
}
}]
'@typescript-eslint/naming-convention': [
error,
{ selector: typeLike, format: [PascalCase] },
{ selector: memberLike, modifiers: [private], format: [camelCase], leadingUnderscore: require },
{ selector: interface, format: [PascalCase], custom: { regex: '^I[A-Z]', match: false } }
]
'@typescript-eslint/consistent-type-assertions': error
'@typescript-eslint/triple-slash-reference': [error, { path: never, types: never, lib: never }]
'@typescript-eslint/type-annotation-spacing': error
# https://github.com/mysticatea/eslint-plugin-eslint-comments#rules
eslint-comments/no-use: [error, { allow: [eslint-disable-line, eslint-disable-next-line] }]
# https://github.com/jest-community/eslint-plugin-jest#rules
jest/consistent-test-it: [error, { fn: it }]
# TODO: https://github.com/jest-community/eslint-plugin-jest/issues/76
# jest/lowercase-name: error
jest/no-focused-tests: error
jest/no-identical-title: error
jest/no-test-prefixes: error
jest/valid-describe: error