forked from xojs/eslint-config-xo-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
100 lines (100 loc) · 2.94 KB
/
index.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
'use strict';
module.exports = {
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
plugins: [
'react'
],
rules: {
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/jsx-child-element-spacing': 'error',
'react/default-props-match-prop-types': 'error',
'react/no-access-state-in-setstate': 'error',
'react/no-array-index-key': 'error',
'react/no-children-prop': 'error',
'react/no-danger': 'error',
'react/no-danger-with-children': 'error',
'react/no-deprecated': 'error',
'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'error',
'react/no-is-mounted': 'error',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': 'error',
'react/no-typos': 'error',
'react/no-string-refs': 'error',
'react/no-this-in-sfc': 'error',
'react/no-unescaped-entities': 'error',
'react/no-unknown-property': 'error',
'react/no-unsafe': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/no-will-update-set-state': 'error',
'react/prop-types': 'error',
'react/react-in-jsx-scope': 'error',
'react/require-default-props': ['error', {
forbidDefaultForRequired: true
}],
'react/self-closing-comp': 'error',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-closing-bracket-location': ['error', {
nonEmpty: 'tag-aligned',
selfClosing: false
}],
'react/jsx-closing-tag-location': 'error',
'react/jsx-curly-spacing': ['error', 'never'],
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 'tab'],
'react/jsx-indent-props': ['error', 'tab'],
'react/jsx-key': 'error',
'react/jsx-max-props-per-line': ['error', {
maximum: 3,
when: 'multiline'
}],
'react/jsx-no-bind': [
'error',
{
allowArrowFunctions: true
}
],
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-duplicate-props': ['error', {
ignoreCase: true
}],
'react/jsx-no-target-blank': 'error',
'react/jsx-no-undef': 'error',
// Disabled for now as it produces too many errors
// 'react/jsx-one-expression-per-line': ['error', {allow: 'single-child'}],
'react/jsx-curly-brace-presence': ['error', 'never'],
'react/jsx-pascal-case': 'error',
'react/jsx-sort-props': ['error', {
callbacksLast: true,
shorthandFirst: true,
noSortAlphabetically: true,
reservedFirst: true
}],
'react/jsx-tag-spacing': ['error', {
closingSlash: 'never',
beforeSelfClosing: 'never',
afterOpening: 'never',
beforeClosing: 'never'
}],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-wrap-multilines': ['error', {
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'ignore',
logical: 'ignore',
prop: 'ignore'
}]
}
};