-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
74 lines (74 loc) · 2.08 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
{
"root": true,
"extends": [
"universe/native",
"universe/node",
"universe/web",
"plugin:react-hooks/recommended"
],
"plugins": ["unused-imports", "react-native"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
// Forbid cyclical dependencies between modules
"import/no-cycle": "error",
// Automatically sort imports for consistency
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
["parent", "sibling", "index"],
"object"
],
"pathGroups": [
{
"group": "object",
"pattern": "*.@(jpg|png|svg)",
"patternOptions": { "matchBase": true }
}
],
"pathGroupsExcludedImportTypes": [],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
],
// Makes sure that we are not deploying console.log's to production
"no-console": "warn",
// Remove any unused imports
"unused-imports/no-unused-imports": "warn",
// Error if an element that likely requires a key
"react/jsx-key": ["error", { "checkFragmentShorthand": true }],
"react-native/no-unused-styles": 2,
// The one of the most common app crash issue are white spaces outside of Text elements
"no-irregular-whitespace": "error",
"no-nested-ternary": "warn",
// Ignore no-unused-vars on vars prepended with _
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"no-else-return": "warn"
},
"overrides": [
{
"files": ["**/*.*(ts|tsx)"],
"rules": {
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/await-thenable": "error"
}
},
{
"files": ["**/*.*(spec|test).*(ts|tsx)"],
"plugins": ["jest"],
"extends": ["plugin:jest/recommended", "plugin:jest/style"]
}
]
}