-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
73 lines (67 loc) · 1.97 KB
/
.eslintrc
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
{
"root": true,
"extends": [
"airbnb",
"airbnb-typescript",
"plugin:jsx-a11y/recommended",
"prettier"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["jsx-a11y", "prettier"],
"rules": {
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": ["draft"] // allow reassignment for immer reducers
}
],
// allow tsx and jsx extensions to have jsx
"react/jsx-filename-extension": [
1,
{
"extensions": [".jsx", ".tsx"]
}
],
// prefer typescript for our typechecking, and https://redux.js.org/introduction/core-concepts for the rest
"react/no-unused-prop-types": 0,
// prefer typescript for our typechecking
"react/prop-types": 0,
// typescript allows us to spread props more predictably although some options are problematic
"react/jsx-props-no-spreading": [
0, // disabled till I can find an alternative in eslint-typescript
{
"html": "ignore", // html spread can be problematic so make sure we are using ts for valid props
"custom": "ignore",
"explicitSpread": "ignore" // this usage is not very readable/useful
}
],
// prefer typescript for typechecking
"react/require-default-props": 0
},
"overrides": [
{
"files": [
"**/*.stories.*" // storybook specific rules
],
"rules": {
// multiple story exports are too common and useful
"import/no-anonymous-default-export": "off",
// prefer to create / reuse components in stories quickly vs verbosly
"react/function-component-definition": [
0,
{ "unnamedComponents": "arrow-function" }
]
}
},
{
"files": ["**/utils/**", "**/constants/**", "**/helpers/**"],
"rules": {
// these modules dirs are typically not going to have a default exports
"import/prefer-default-export": 0
}
}
]
}