-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
105 lines (105 loc) · 2.94 KB
/
.eslintrc.js
File metadata and controls
105 lines (105 loc) · 2.94 KB
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
// https://docs.expo.dev/guides/using-eslint/
module.exports = {
root: true,
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-native/all",
// `expo` must come after `standard` or its globals configuration will be overridden
"expo",
// `jsx-runtime` must come after `expo` or it will be overridden
"plugin:react/jsx-runtime",
"prettier",
],
plugins: ["reactotron", "prettier"],
rules: {
"prettier/prettier": "error",
// typescript-eslint
"@typescript-eslint/array-type": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-require-imports": 0,
"@typescript-eslint/no-empty-object-type": 0,
// eslint
"no-use-before-define": 0,
"no-restricted-imports": [
"error",
{
paths: [
// Prefer named exports from 'react' instead of importing `React`
{
name: "react",
importNames: ["default"],
message: "Import named exports from 'react' instead.",
},
{
name: "react-native",
importNames: ["SafeAreaView"],
message: "Use the SafeAreaView from 'react-native-safe-area-context' instead.",
},
{
name: "react-native",
importNames: ["Text", "Button", "TextInput"],
message: "Use the custom wrapper component from '@/components'.",
},
],
},
],
// react
"react/prop-types": 0,
// react-native
"react-native/no-raw-text": 0,
// reactotron
"reactotron/no-tron-in-production": "error",
// eslint-config-standard overrides
"comma-dangle": 0,
"no-global-assign": 0,
"quotes": 0,
"space-before-function-paren": 0,
// eslint-import
"import/order": [
"error",
{
"alphabetize": {
order: "asc",
caseInsensitive: true,
},
"newlines-between": "always",
"groups": [["builtin", "external"], "internal", "unknown", ["parent", "sibling"], "index"],
"distinctGroup": false,
"pathGroups": [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "react-native",
group: "external",
position: "before",
},
{
pattern: "expo{,-*}",
group: "external",
position: "before",
},
{
pattern: "@/**",
group: "unknown",
position: "after",
},
],
"pathGroupsExcludedImportTypes": ["react", "react-native", "expo", "expo-*"],
},
],
"import/newline-after-import": 1,
},
}