-
Notifications
You must be signed in to change notification settings - Fork 591
/
.eslintrc.js
61 lines (61 loc) · 1.77 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
module.exports = {
root: true,
extends: '@react-native',
plugins: ['import'],
rules: {
// disabled rules
'prettier/prettier': 'off',
'react-native/no-inline-styles': 'off',
'no-fallthrough': 'off',
curly: 'off',
// error rules
semi: 'error',
'key-spacing': [2, { beforeColon: false, afterColon: true }],
'require-await': 'error',
indent: [
'error',
2,
{
ignoredNodes: ['TemplateLiteral'], // https://github.com/babel/babel-eslint/issues/681#issuecomment-451336031
SwitchCase: 1,
},
],
'no-console': 'error',
'no-debugger': 'error',
'prefer-const': 'error',
'no-multiple-empty-lines': 'error',
'no-unused-vars': 'error',
'no-trailing-spaces': 'error',
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'react/jsx-boolean-value': 'error',
'react/jsx-closing-bracket-location': 'error',
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
'max-len': [
'error',
{
code: 120,
ignoreTemplateLiterals: true,
// FIXME: doesn't work :/
ignorePattern: '^log\\(', // ignore "log('...')"
ignoreUrls: true, // ignore long urls
},
],
'import/no-unresolved': ['error', { commonjs: true, amd: true }],
'import/named': 'error',
'import/namespace': 'error',
'import/default': 'error',
'import/export': 'error',
},
settings: {
'import/ignore': ['node_modules/react-native/index\\.js$'], // https://github.com/facebook/react-native/issues/28549
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx', '.android.js', '.ios.js', '.android.tsx', '.ios.tsx'],
},
},
},
globals: {
WebSocket: true,
URLSearchParams: true,
},
};