-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
92 lines (90 loc) · 2.63 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
{
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"es6": true,
"node": true,
"jest/globals": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-native-a11y/all"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["react", "react-native", "jest", "simple-import-sort"],
"ignorePatterns": ["**/__mocks__/*"],
"rules": {
// General ESLINT rules
"brace-style": ["error", "1tbs", { "allowSingleLine": true}],
"eol-last": ["error", "always"],
"indent": ["error", 2, {"SwitchCase": 1}],
"linebreak-style": ["error", "unix"],
"max-len": ["warn", 100, 2, {
"ignoreUrls": true,
"ignorePattern": "^import\\s.+\\sfrom\\s.+;$"
}],
"multiline-ternary": ["error", "always"],
"no-multiple-empty-lines": ["error", {"max": 1}],
"no-unneeded-ternary": "error",
"no-nested-ternary": "error",
"no-unused-vars": ["error", {"varsIgnorePattern": "(React)"}],
"semi": ["error", "never"],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"quotes": ["error", "single"],
// Specific REACT rules
"react/jsx-uses-vars": "error",
"react/button-has-type": "warn",
"react/destructuring-assignment": "off",
"react/prop-types": "off",
// Specific REACT NATIVE rules
"react-native/no-unused-styles": "error",
"react-native/split-platform-components": "off",
"react-native/no-inline-styles": "warn",
"react-native/no-color-literals": "off",
"react-native/no-raw-text": "off",
"react-native/no-single-element-style-arrays": "error"
},
"overrides": [
// 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)$"]
]
}
]
}
}
]
}