-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path.eslintrc.json
97 lines (97 loc) · 2.64 KB
/
.eslintrc.json
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
{
"root": true,
"env": {
"es6": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:flowtype/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:prettier/recommended",
"prettier"
],
"parser": "@babel/eslint-parser",
"plugins": [
"react",
"react-hooks",
"flowtype",
"monorepo",
"import",
"@stylistic/js",
"unicorn"
],
"rules": {
// Prettier is configured to keep lines to 80 chars, but there are two issues:
// - It doesn't handle comments (leaves them as-is)
// - It makes all import statements take one line (reformats them)
// We want ESLint to warn us in the first case, but not in the second case
// since Prettier forces us in the second case. By setting code to 5000, we
// make sure ESLint defers to Prettier for import statements.
"@stylistic/js/max-len": [
"error",
{ "code": 5000, "comments": 80, "ignoreUrls": true }
],
"flowtype/require-valid-file-annotation": ["error", "always"],
"flowtype/require-exact-type": ["error", "never"],
"curly": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"monorepo/no-relative-import": "error",
"no-empty": ["error", { "allowEmptyCatch": true }],
"import/no-unresolved": 0,
"no-unused-vars": ["error", { "ignoreRestSiblings": true }],
"react/prop-types": ["error", { "skipUndeclared": true }],
"no-shadow": 1,
"no-var": "error",
"import/extensions": ["error", "always"],
"import/order": [
"warn",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"groups": [["builtin", "external"], "internal"]
}
],
"prefer-const": "error",
"react/jsx-curly-brace-presence": [
"error",
{ "props": "never", "children": "ignore" }
],
"eqeqeq": ["error", "always"],
"no-constant-condition": ["error", { "checkLoops": false }],
"consistent-return": "error",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase",
"ignore": [".*_v.*\\.*\\.*\\.js", ".*ModuleSchema\\.js"]
}
]
},
"settings": {
"react": {
"version": "detect"
},
"import/ignore": ["react-native"],
"import/internal-regex": "^(lib|native|keyserver|web)/"
},
"overrides": [
{
"files": "*.cjs",
"env": {
"node": true,
"commonjs": true
},
"rules": {
"flowtype/require-valid-file-annotation": 0,
"flowtype/require-exact-type": 0
}
}
]
}