-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.yml
77 lines (77 loc) · 3.04 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
---
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.json
settings:
react:
version: detect
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: 1 # Shouldn't use "console", but "logger" instead
allowArrowFunctions: 0
no-unused-vars:
- warn # Warn otherwise it false-positive with needed React imports
- args: none # Allow to declare unused variables in function arguments, meant to be used later
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-return-await: 0 # Useful before, but recent node.js enhancements make it useless on node 12+ (we use 10, but still, for consistency) - Read https://stackoverflow.com/questions/44806135/why-no-return-await-vs-const-x-await
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-ignore': warn
'@typescript-eslint/no-use-before-define': warn