-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
107 lines (100 loc) · 2.35 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
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
106
107
/** @type {import("eslint").ESLint.ConfigData} */
// eslint-disable-next-line no-undef
module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-native/all',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:mobx/recommended',
'prettier',
],
plugins: [
'react',
'react-hooks',
'react-native',
'@typescript-eslint',
'mobx',
'import',
],
parser: '@typescript-eslint/parser',
settings: {
react: { version: 'detect' },
},
rules: {
'no-empty': 'warn',
'no-console': 'warn',
'prefer-const': 'warn',
'react-native/no-raw-text': [
'error',
{
skip: [
'Chip',
'DataTable.Title',
'HelperText',
'Button',
'Dialog.Title',
],
},
],
'react-native/sort-styles': 'off',
'react-native/no-inline-styles': 'off',
'react/prop-types': 'off',
// Disabling allowSyntheticalDefaultExport in tsconfig will cause
// untyped components
// but when its enabled its easy to shoot yourself in the feet by using
// import x from 'expo-updates'
// bc x will be undefined in the runtime. So we need another way to
// warn developer using eslint plugin.
'import/default': 'error',
'mobx/missing-make-observable': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: ['objectLiteralMethod', 'objectLiteralProperty'],
format: null,
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'variable',
modifiers: ['exported', 'const'],
format: ['UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'import',
format: null,
},
],
},
root: true,
ignorePatterns: ['docs/*'],
}