-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
132 lines (113 loc) · 3.28 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
module.exports = {
"env": {
"browser": true,
"node": true,
"es6": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"linebreak-style": ["error", (require("os").EOL === "\r\n" ? "windows" : "unix")],
// disallow use of eval()
"no-eval": "error",
"no-console": "off",
// specify whether double or single quotes should be used
"quotes": ["error", "double"],
// disallow un-paren'd mixes of different operators
// https://eslint.org/docs/rules/no-mixed-operators
"no-mixed-operators": ["error", {
// the list of arthmetic groups disallows mixing `%` and `**`
// with other arithmetic operators.
groups: [
["%", "**"],
["%", "+"],
["%", "-"],
["%", "*"],
["%", "/"],
["**", "+"],
["**", "-"],
["**", "*"],
["**", "/"],
["&", "|", "^", "~", "<<", ">>", ">>>"],
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
["&&", "||"],
["in", "instanceof"]
],
allowSamePrecedence: false
}],
// disallow mixed spaces and tabs for indentation
"no-mixed-spaces-and-tabs": "error",
// enforces spacing between keys and values in object literal properties
"key-spacing": ["off"],
// "key-spacing": [2, {
// "singleLine": {
// "beforeColon": false,
// "afterColon": true
// },
// "multiLine": {
// "beforeColon": true,
// "afterColon": true,
// "align": "colon"
// }
// }],
"comma-spacing": [2, {
"before": false,
"after": true
}],
// require or disallow space before blocks
"space-before-blocks": "error",
// require or disallow space before function opening parenthesis
// https://eslint.org/docs/rules/space-before-function-paren
"space-before-function-paren": ["error", {
anonymous: "always",
named: "never",
asyncArrow: "always"
}],
// require or disallow spaces inside parentheses
"space-in-parens": ["error", "never"],
// require spaces around operators
"space-infix-ops": "off",
// Require or disallow spaces before/after unary operators
// https://eslint.org/docs/rules/space-unary-ops
"space-unary-ops": ["error", {
words: true,
nonwords: false,
overrides: {
},
}],
// disallow space between function identifier and application
"no-spaced-func": "off",
// disallow tab characters entirely
"no-tabs": "error",
// disallow the use of ternary operators
"no-ternary": "off",
// disallow trailing whitespace at the end of lines
"no-trailing-spaces": ["error", {
skipBlankLines: false,
ignoreComments: false,
}],
// disallow use of multiple spaces
"no-multi-spaces": ["error", {
ignoreEOLComments: false,
}],
// require space before/after arrow function's arrow
// https://eslint.org/docs/rules/arrow-spacing
"arrow-spacing": ["error", { before: true, after: true }],
// prop-type
"react/prop-types": ["off"]
},
"reportUnusedDisableDirectives": true
};