-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.js
64 lines (64 loc) · 1.79 KB
/
.eslintrc.js
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
module.exports = {
root: true,
extends: [
"@react-native-community/eslint-config", // Default RN config
"standard-with-typescript", // Installed in step 2
"eslint-config-prettier", // Installed in step 3
],
parser: "@typescript-eslint/parser", // Installed in step 2
plugins: [
"@typescript-eslint", // Installed in step 2
"react", // Installed in step 1
"react-native", // Installed in step 1
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: "./tsconfig.json", // Required for Standard plugin
},
env: {
"react-native/react-native": true,
},
rules: {
"prettier/prettier": "off", // Turn off prettier
// These are the rules that I use
"react-native/no-unused-styles": "warn",
"react-native/no-inline-styles": "error",
"react-native/no-raw-text": [
"warn",
{
skip: ["CustomText"],
},
],
"react-native/no-single-element-style-arrays": "warn",
"object-curly-spacing": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/require-array-sort-compare": [
"error",
{
ignoreStringArrays: true,
},
],
"react/jsx-curly-spacing": [
"error",
{
when: "always",
allowMultiline: true,
children: true,
},
],
"eol-last": ["error", "always"],
"no-multiple-empty-lines": "error",
semi: ["error", "never"],
// Indent with 2 spaces
indent: ["error", 2],
// Indent JSX with 2 spaces
"react/jsx-indent": ["error", 2],
// Indent props with 2 spaces
"react/jsx-indent-props": ["error", 2],
},
};