-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
69 lines (67 loc) · 2.72 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
module.exports = {
extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
"@stellar-expert/eslint-config-js"
],
parserOptions: {
ecmaFeatures: {
'jsx': true,
'modules': true
}
},
plugins: [
'react'
],
rules: {
//OFF
'react/prop-types': 'off',
'react/forbid-prop-types': 'off',
'react/require-default-props': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-props-no-spreading': 'off',
//WARN
'react/function-component-definition': ['warn', {namedComponents: 'function-declaration'}],
'react/sort-comp': 'warn',
'react/no-unused-prop-types': 'warn',
'react/no-array-index-key': 'warn',
'react/no-access-state-in-setstate': 'warn',
'react/no-unused-state': 'warn',
'react/default-props-match-prop-types': 'warn',
'react/hook-use-state': 'warn',
'react/self-closing-comp': 'warn',
'react/jsx-curly-brace-presence': ['warn', {props: 'never', children: 'never', propElementValues: 'always'}],
'react/jsx-first-prop-new-line': ['warn', 'never'],
'react/jsx-boolean-value': ['warn', 'never'],
'react/jsx-fragments': ['warn', 'syntax'],
'react/jsx-no-bind': 'warn',
'react/jsx-no-constructed-context-values': 'warn',
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-no-leaked-render': 'warn',
//ERROR
'indent': ['error', 4, {ignoredNodes: ['JSXElement *']}],
'react/jsx-indent': ['error', 4, {indentLogicalExpressions: true, checkAttributes: true}],
'react/jsx-indent-props': ['error', 'first'],
'react/no-this-in-sfc': 'error',
'react/no-typos': 'error',
'react/prefer-stateless-function': 'error',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
'react/jsx-closing-bracket-location': ['error', {selfClosing: 'after-props', nonEmpty: 'after-props'}],
'react/jsx-curly-spacing': ['error', {when: 'never'}],
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
'react/jsx-no-script-url': 'error',
'react/jsx-props-no-multi-spaces': 'error',
'react/jsx-pascal-case': ['error', {allowNamespace: true}],
'react/jsx-tag-spacing': ['error', {closingSlash: 'never', beforeSelfClosing: 'never', beforeClosing: 'never'}]
},
'settings': {
'react': {
'pragma': 'React',
'version': 'detect'
}
}
}