This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
forked from flexn-io/renative
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
executable file
·123 lines (123 loc) · 4.16 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
module.exports = {
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
}
},
parser: '@babel/eslint-parser',
extends: ['airbnb'],
env: {
node: true,
browser: true,
es6: true,
jest: true,
mocha: true
},
parserOptions: {
requireConfigFile: false,
ecmaFeatures: {
experimentalObjectRestSpread: true
},
babelOptions: {
presets: ['@babel/preset-react']
}
},
plugins: ['jest', 'detox', 'mocha'],
rules: {
//= ===========
'function-paren-newline': 'off',
'arrow-parens': 'off',
'no-multiple-empty-lines': 'off',
'function-call-argument-newline': 'off',
'default-param-last': 'off',
'no-promise-executor-return': 'off',
'react/destructuring-assignment': 'off',
'react/function-component-definition': 'off',
'max-classes-per-file': 'off',
'import/no-relative-packages': 'off',
'import/extensions': 'off',
'react/no-unstable-nested-components': 'off',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-wrap-multilines': 'off',
'prefer-object-spread': 'off',
'react/jsx-no-constructed-context-values': 'off',
'react/prop-types': 'off',
//= ===========
'no-unused-vars': ['error'],
'arrow-body-style': ['warn', 'as-needed'],
'import/no-cycle': ['warn'],
camelcase: 'off',
'class-methods-use-this': 'off',
'consistent-return': 0,
indent: ['error', 4, { SwitchCase: 1 }],
'new-cap': ['error', { capIsNew: false }],
'no-duplicate-imports': 'off',
'no-param-reassign': [
'error',
{ ignorePropertyModificationsFor: ['el', 'ref', 'event'] }
],
'no-plusplus': 'off',
'no-shadow': [
'error',
{ builtinGlobals: false, hoist: 'functions', allow: ['describe'] }
],
'no-use-before-define': 0,
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'nonblock-statement-body-position': 0,
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }],
'react/jsx-indent': ['error', 4],
'react/jsx-indent-props': ['error', 4],
'react/require-extension': 'off',
'react/sort-comp': [
'error',
{
order: [
'type-annotations',
'static-methods',
'lifecycle',
'/^on.+$/',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'everything-else',
'/^render.+$/',
'render'
]
}
],
'object-curly-newline': [
'error',
{
ObjectExpression: {
minProperties: 6,
multiline: true,
consistent: true
},
ObjectPattern: {
minProperties: 6,
multiline: true,
consistent: true
}
}
],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/mouse-events-have-key-events': 'off',
'comma-dangle': ['error', 'only-multiline'],
'no-underscore-dangle': 'off',
'mocha/no-exclusive-tests': 'error',
'prefer-destructuring': ['error', { object: true, array: false }],
'prefer-promise-reject-errors': 'off',
'max-len': [
'warn',
{ code: 120, ignoreComments: true, ignoreStrings: true }
],
'linebreak-style': ['error', process.platform === 'win32' ? 'windows' : 'unix']
}
};