-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc
108 lines (106 loc) · 3.02 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
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
{
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"extends": [
"airbnb",
"airbnb/hooks",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/recommended"
],
"plugins": ["react", "import", "simple-import-sort"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/jsx-indent-props": [2, 2],
"react/jsx-indent": [2, 2],
"react/jsx-one-expression-per-line": [0],
"react/prefer-stateless-function": [1],
"react/static-property-placement": [1, "property assignment"],
"react/no-multi-comp": ["error", { "ignoreStateless": true }],
"react/prop-types": "warn",
"semi": 2,
"comma-dangle": "error",
"no-underscore-dangle": "error",
"space-before-blocks": "error",
"keyword-spacing": "error",
"spaced-comment": "error",
"quotes": ["error", "single"],
"prefer-template": "warn",
"template-curly-spacing": ["error", "never"],
"jsx-quotes": ["warn", "prefer-double"],
"camelcase": ["warn", { "properties": "always" }],
"no-unused-vars": ["warn"],
"import/order": "off",
"import/prefer-default-export": ["warn", { "target": "any" }],
"import/no-duplicates": ["error", { "considerQueryString": true }],
"simple-import-sort/imports": "error",
"import/first": "error",
"import/newline-after-import": "error"
},
"overrides": [
// Exceptions for ESLint related files
{
"env": {
"node": true
},
"files": [".eslintrc.{js,cjs}"],
"parserOptions": {
"sourceType": "script"
}
},
// Override "simple-import-sort" config
{
"files": ["*.js", "*.jsx", "*.ts", "*.tsx"],
"rules": {
"simple-import-sort/imports": [
"error",
{
"groups": [
// Packages `react` related packages come first.
["^react", "^@?\\w"],
// Internal packages.
["^(@|components)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.?(css)$"]
]
}
],
"simple-import-sort/exports": "error"
}
},
// Exception rules for specific packages
{
"files": ["*.js", "*.jsx", "*.ts", "*.tsx"],
"rules": {
"no-underscore-dangle": [
"error",
{
// Rewire methods
"allow": ["__get__", "__set__", "__reset__"]
}
]
}
}
]
}