-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
108 lines (106 loc) · 3.69 KB
/
.eslintrc
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
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier"],
"plugins": ["react", "jsx-a11y", "import"],
"env": {
"browser": true,
"node": true,
"jest": true
},
"rules": {
"arrow-body-style": "off",
"curly": ["error", "all"],
"class-methods-use-this": "warn",
"consistent-return": "off",
"brace-style": "error",
"default-case": ["error", { "commentPattern": "^default\\sis\\sredundant" }],
"function-paren-newline": ["error", "consistent"],
"implicit-arrow-linebreak": ["error", "beside"],
"key-spacing": "error",
"keyword-spacing": ["error", { "before": true, "after": true }],
"no-constant-condition": "error",
"no-continue": "off",
"no-else-return": ["error", { "allowElseIf": true }],
"no-plusplus": "off",
"no-restricted-syntax": [
"error",
{ "selector": "MethodDefinition[kind='set']", "message": "Property setters are not allowed" },
{ "selector": "MethodDefinition[kind='get']", "message": "Property getters are not allowed" },
{
"selector": "LabeledStatement",
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
},
{
"selector": "WithStatement",
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
}
],
"no-shadow": "warn",
"no-trailing-spaces": "error",
"no-underscore-dangle": ["error", { "allowAfterThis": true, "allowAfterSuper": true }],
"no-useless-escape": "off",
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"padding-line-between-statements": ["error", { "blankLine": "always", "prev": "*", "next": "return" }],
"prefer-destructuring": "off",
"rest-spread-spacing": ["error", "never"],
"import/prefer-default-export": "off",
"react/no-array-index-key": "off",
"react/prefer-stateless-function": "off",
"react/prefer-es6-class": ["error", "always"],
"react/require-default-props": "off",
"react/sort-comp": [
"error",
{
"order": ["static-methods", "lifecycle", "everything-else", "private", "listeners", "rendering"],
"groups": {
"lifecycle": [
"displayName",
"propTypes",
"defaultProps",
"contextTypes",
"childContextTypes",
"mixins",
"statics",
"state",
"getDefaultProps",
"getDerivedStateFromProps",
"getInitialState",
"constructor",
"getChildContext",
"componentWillMount",
"UNSAFE_componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"UNSAFE_componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"UNSAFE_componentWillUpdate",
"getSnapshotBeforeUpdate",
"componentDidUpdate",
"componentDidCatch",
"componentWillUnmount"
],
"rendering": ["/^render.+$/", "render"],
"listeners": ["/^_on[A-Z]\\w*$/", "/^_onRef[A-Z]\\w*$/"],
"private": ["/^_\\w+"]
}
}
],
"react/jsx-handler-names": [
"error",
{
"eventHandlerPrefix": "_on",
"eventHandlerPropPrefix": "(on|ref|inner)"
}
],
"react/jsx-key": "error",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/label-has-for": "off",
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": "off",
"import/no-extraneous-dependencies": "off",
"import/no-useless-path-segments": "off",
"react/forbid-foreign-prop-types": "off"
}
}