-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
48 lines (41 loc) · 1.66 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
module.exports = {
"env" : {
"browser" : true,
"node" : true
},
"parserOptions" : {
"ecmaVersion" : 6,
"sourceType" : "module",
"ecmaFeatures" : {
"jsx" : true
}
},
"plugins" : [
"react"
],
"extends" : "eslint:recommended",
"rules" : {
"semi" : 2,
"indent" : [2, 2],
"no-console" : 1,
"no-process-env" : 0,
// ES6
"prefer-const" : 1,
// eslint-plugin-react
"react/display-name" : 0, // Prevent missing displayName in a React component definition
"react/jsx-no-undef" : 2, // Disallow undeclared variables in JSX
"react/jsx-indent" : [2, 2], // 2 spaces intendation in JSX
"react/jsx-indent-props" : [2, 2], // 2 spaces intendation in JSX for props
"react/jsx-sort-props" : 0, // Enforce props alphabetical sorting
"react/jsx-uses-react" : 2, // Prevent React to be incorrectly marked as unused
"react/jsx-uses-vars" : 2, // Prevent variables used in JSX to be incorrectly marked as unused
"react/no-did-mount-set-state" : 2, // Prevent usage of setState in componentDidMount
"react/no-did-update-set-state" : 2, // Prevent usage of setState in componentDidUpdate
"react/no-multi-comp" : 0, // Prevent multiple component definition per file
"react/no-unknown-property" : 2, // Prevent usage of unknown DOM property
"react/prop-types" : 1, // Prevent missing props validation in a React component definition
"react/react-in-jsx-scope" : 2, // Prevent missing React when using JSX
"react/self-closing-comp" : 2, // Prevent extra closing tags for components without children
"react/wrap-multilines" : 2 // Prevent missing parentheses around multilines JSX
}
};