-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.yaml
101 lines (93 loc) · 4 KB
/
eslint.yaml
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
---
extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:react/recommended
- plugin:promise/recommended
- plugin:jest/recommended
- prettier
env:
browser: true
es6: true
node: true
parser: "@typescript-eslint/parser"
parserOptions:
project: tsconfig.json
sourceType: module
plugins:
- "@typescript-eslint"
- react
- unicorn
settings:
react:
version: detect
rules:
consistent-return: error
default-case: error
default-param-last: error
no-loop-func: off
arrow-body-style: [error, as-needed]
no-constant-condition: off
unicorn/no-abusive-eslint-disable: error
unicorn/no-array-instanceof: error
unicorn/no-unreadable-array-destructuring: error
unicorn/no-zero-fractions: error
react/jsx-key: error
react/jsx-pascal-case: error
react/destructuring-assignment: warn
react/function-component-definition: [error, {namedComponents: arrow-function, unnamedComponents: arrow-function}]
react/no-array-index-key: error
react/no-deprecated: error
react/no-string-refs: error
react/no-this-in-sfc: error
react/no-typos: error
react/no-unknown-property: error
react/prefer-stateless-function: error
react/prop-types: off
jest/expect-expect: off
jest/no-jasmine-globals: off
promise/no-return-wrap: error
promise/always-return: error
promise/no-nesting: error
"@typescript-eslint/array-type": [error, {default: array-simple}]
"@typescript-eslint/await-thenable": error
"@typescript-eslint/no-unused-vars": error
"@typescript-eslint/no-use-before-define": off
"@typescript-eslint/consistent-type-assertions": [error, {assertionStyle: as}]
"@typescript-eslint/no-unsafe-return": off
"@typescript-eslint/no-unsafe-assignment": off
"@typescript-eslint/no-unsafe-member-access": off
"@typescript-eslint/explicit-module-boundary-types": off
"@typescript-eslint/no-unsafe-call": off
"@typescript-eslint/ban-types": off
"@typescript-eslint/restrict-template-expressions": off
# supported in newer version, but not compatible with our react-scripts version
# "@typescript-eslint/explicit-member-accessibility": [error, {accessibility: explicit}]
# "@typescript-eslint/no-non-null-asserted-optional-chain": error
# "@typescript-eslint/no-unnecessary-boolean-literal-compare": error
# "@typescript-eslint/prefer-as-const": error
# "@typescript-eslint/switch-exhaustiveness-check": error
# "@typescript-eslint/explicit-module-boundary-types": error
"@typescript-eslint/no-extra-non-null-assertion": error
"@typescript-eslint/no-inferrable-types": error
"@typescript-eslint/no-misused-promises": off
"@typescript-eslint/no-this-alias": error
"@typescript-eslint/no-throw-literal": error
"@typescript-eslint/prefer-nullish-coalescing": error
"@typescript-eslint/prefer-optional-chain": error
"@typescript-eslint/prefer-readonly": error
"@typescript-eslint/unbound-method": error
"@typescript-eslint/explicit-function-return-type": [error, {allowExpressions: true, allowTypedFunctionExpressions: true, allowHigherOrderFunctions: true,}]
"@typescript-eslint/no-unnecessary-condition": off
"@typescript-eslint/no-unsafe-argument": off
#debatable
"react/display-name": off #does not recognize function component names
"@typescript-eslint/no-floating-promises": off #we edit state in async overmind actions and throw errors, therefore no problem
"@typescript-eslint/no-non-null-assertion": off #we assert values because a lot of ff id's are optional, even though, they really aren't
"@typescript-eslint/camelcase": off #we use _ in some of our variables and attributes
"promise/catch-or-return": off #conflicts with handleApiError function that is used for error toasts
"@typescript-eslint/ban-ts-ignore": off
"no-case-declarations": off #case with {} just isn't good
"@typescript-eslint/no-explicit-any": off #the legend tells of a hero with extensive Generics knowledge, that is able to enforce this rule