-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
148 lines (130 loc) · 2.78 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
module.exports = {
'env': {
'browser': true,
'es6': true,
'react-native/react-native': true
},
'globals': {
'__DEV__': false,
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly'
},
'extends': [
'eslint:recommended',
'plugin:react/recommended'
],
'parser': 'babel-eslint',
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
'ecmaVersion': 2018,
'sourceType': 'module'
},
'plugins': [
'react',
'react-native',
'react-hooks'
],
'rules': {
'react/no-unescaped-entities': 'off',
'semi': [
'error',
'always'
],
'dot-notation': 'error',
'no-var': 'error',
'no-multi-assign': 'error',
'no-eval': 'error',
'no-new-wrappers': 'error',
'no-else-return': 'error',
'default-case': 'error',
'implicit-arrow-linebreak': 'error',
'prefer-rest-params': 'error',
'comma-dangle': [
'error',
'never'
],
'one-var': [
'error',
'never'
],
'quotes': [
'error',
'single',
{ 'allowTemplateLiterals': true }
],
'indent': [
'error',
'tab',
{
// `case` statements should be indented
'SwitchCase': 1,
// Multi-line method chaining doesn't need a strict indentation rule.
// Sometimes it looks nice not to indent, othertimes it looks nicer to indent.
'MemberExpression': 'off'
}
],
'spaced-comment': [
'error',
'always',
{
// Allow large header-style comments
'exceptions': ['/'],
// Allow triple slash comments
'markers': ['/']
}
],
'func-call-spacing': [
'error',
'never'
],
'comma-spacing': 'error',
'keyword-spacing': 'error',
'arrow-spacing': 'error',
'space-before-blocks': 'error',
'no-trailing-spaces': 'error',
'eol-last': 'error',
'space-in-parens': [
'error',
'never'
],
'array-bracket-spacing': [
'error',
'never'
],
'object-curly-spacing': [
'error',
'always'
],
'key-spacing': [
'error',
{ 'mode': 'minimum' }
],
// REACT SPECIFIC RULES
// -------------------------------------
// JSX quotes should always be double quotes.
'jsx-quotes': [
'error',
'prefer-double'
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// Only validate prop type definitions if they exist.
'react/prop-types': [
2,
{ 'skipUndeclared': true }
],
// DISABLE SOME RECOMMENDED SETTINGS
// -------------------------------------
// When doing this, always explain why.
// Allow unused function arguments (but still check for other unused vars).
// It's common to use a function as a callback where there is an expected function
// signature, but you may not use all the arguments at the time. It shouldn't be a
// problem to leave the extra arguments, which can be helpful later in time.
'no-unused-vars': [
'error',
{ 'args': 'none' }
]
}
};