-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.js
106 lines (106 loc) · 3.27 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
module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended'
],
root: true,
rules: {
'comma-dangle': 'off',
semi: [2, 'never'],
indent: ['error', 4, { SwitchCase: 1 }],
'no-trailing-spaces': 'error',
'arrow-parens': 'off',
'react/prop-types': 'off',
'no-extra-semi': 'error',
'react/display-name': [2, { 'ignoreTranspilerName': true }],
'react/jsx-max-props-per-line': [1, { maximum: 1, when: 'multiline' }],
'react/jsx-one-expression-per-line': [2, { 'allow': 'none' }],
'react/jsx-sort-props': [
2,
{
'callbacksLast': false,
'shorthandFirst': false,
'shorthandLast': false,
'ignoreCase': false,
'noSortAlphabetically': true
}
],
'react/boolean-prop-naming': [
'error',
{
'propTypeNames': ['bool'],
'rule': '^(is|has)[A-Z]([A-Za-z0-9]?)+',
'message': 'It is better if your prop ({{ propName }}) matches this pattern: ({{ pattern }})',
'validateNested': true
}
],
'react/default-props-match-prop-types': [2, { 'allowRequiredDefaults': true }],
'react/jsx-curly-newline': [
'error',
{
multiline: 'consistent',
singleline: 'consistent'
}
],
'react/jsx-handler-names': [
'error',
{
checkLocalVariables: true,
checkInlineFunction: true
}
],
'react/jsx-indent-props': ['error', 4],
'react/jsx-props-no-multi-spaces': 'error',
'react/jsx-sort-default-props': 'error',
'react/jsx-tag-spacing': [
'error',
{
'beforeSelfClosing': 'never',
'beforeClosing': 'never'
}
],
'react/jsx-wrap-multilines': [
'error',
{
'declaration': 'parens-new-line',
'assignment': 'parens-new-line',
'return': 'parens-new-line',
'arrow': 'parens-new-line',
'condition': 'parens-new-line',
'logical': 'parens-new-line',
'prop': 'parens-new-line'
}
],
'react/prefer-stateless-function': 'error'
},
parser: 'babel-eslint',
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.d.ts', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src']
}
},
'react': {
'createClass': 'createReactClass',
'pragma': 'React',
'fragment': 'Fragment',
'flowVersion': '0.53',
'version': '16.13.1'
},
'propWrapperFunctions': [
'forbidExtraProps',
{ 'property': 'freeze', 'object': 'Object' },
{ 'property': 'withDisplayName' }
],
'linkComponents': [
'Hyperlink',
{ 'name': 'Link', 'linkAttribute': 'to' }
]
},
'env': {
'node': true,
jest: true,
es6: true
}
}