-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.yml
81 lines (81 loc) · 3.42 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
---
env:
browser: true
commonjs: true
es6: true
node: true
extends:
- plugin:@typescript-eslint/recommended
globals:
Atomics: readonly
SharedArrayBuffer: readonly
plugins:
- jest
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.eslint.json
rules: # See https://eslint.org/docs/rules
semi:
- error
- always # Always put commas, to avoid multilines git diff when new lines are added
quotes:
- error
- single # Prefer simple quotes
- allowTemplateLiterals: true # Allow the use of `` instead of '' and don't try to replace it, even when `` isn't needed
comma-spacing:
- error
- before: false
after: true
indent:
- error
- 2
- SwitchCase: 1
arrow-parens:
- error
- always
max-len: 0 # Disable line length checks, because the IDE is already configured to warn about it, and it's a waste of time to check for lines that are too long, especially in comments (like this one!)
strict: 'off'
no-console: 0
allowArrowFunctions: 0
no-unused-vars: 0 # Disabled, already handled by @typescript-eslint/no-unused-vars
import/prefer-default-export: 0 # When there is only a single export from a module, don't enforce a default export, but rather let developer choose what's best
no-else-return: 0 # Don't enforce, let developer choose. Sometimes we like to specifically use "return" for the sake of comprehensibility and avoid ambiguity
no-underscore-dangle: 0 # Allow _ before/after variables and functions, convention for something meant to be "private"
arrow-body-style: 0 # Don't enforce, let developer choose. Sometimes we like to specifically use "return" for ease of debugging and printing
quote-props:
- warn
- consistent-as-needed # Enforce consistency with quotes on props, either all must be quoted, or all unquoted for a given object
no-extra-boolean-cast: 0 # Don't enforce, let developer choose. Using "!!!" is sometimes useful (edge cases), and has a semantic value (dev intention)
object-curly-newline:
- warn
- ObjectExpression:
multiline: true
minProperties: 5
consistent: true
ObjectPattern:
multiline: true
minProperties: 5
consistent: true
ImportDeclaration:
multiline: true
minProperties: 8 # Doesn't play so well with webstorm, which wraps based on the number of chars in the row, not based on the number of props #sucks
consistent: true
ExportDeclaration:
multiline: true
minProperties: 5
consistent: true
linebreak-style:
- error
- unix
'@typescript-eslint/ban-ts-comment': warn # ts-ignore are sometimes the only way to bypass a TS issue, we trust we will use them for good and not abuse them
'@typescript-eslint/no-use-before-define': warn
'@typescript-eslint/no-unused-vars':
- warn
- vars: 'all' # We don't want unused variables (noise) - XXX Note that this will be a duplicate of "no-unused-vars" rule
args: 'none' # Sometimes it's useful to have unused arguments for later use, such as describing what args are available (DX)
ignoreRestSiblings: true # Sometimes it's useful to have unused props for later use, such as describing what props are available (DX)
'@typescript-eslint/ban-types':
- error
- extendDefaults: true
types:
'{}': false # Allow writing `type Props = {}` - See https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-632833366