-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.eslintrc.js
56 lines (56 loc) · 1.74 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
module.exports = {
root: true,
extends: [
'@react-native-community/eslint-config', // Default RN config
'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': 'off',
'react-native/no-raw-text': ['off', {
skip: ['CustomText']
}],
"react-native/no-single-element-style-arrays": "warn",
'object-curly-spacing': 'off',
'@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', 'always'],
// Indent with 2 spaces
indent: ['error', 2],
// Indent JSX with 2 spaces
'react/jsx-indent': ['error', 2],
"no-unused-vars": "error",
// Indent props with 2 spaces
'react/jsx-indent-props': ['error', 2],
'react/no-unstable-nested-components' : 'off'
}
};