-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.js
42 lines (42 loc) · 1.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
module.exports = {
root: true,
env: {
node: true,
},
extends: ["react-app", "react-app/jest", "eslint:recommended"],
parserOptions: {
ecmaVersion: 2020,
},
plugins: ["prettier"],
rules: {
"prettier/prettier": "error",
eqeqeq: ["error", "always"], // 需要使用===和!==
"no-var": "error",
"no-new-object": "error",
"object-shorthand": "error",
// "prefer-object-spread": "error",
"prefer-destructuring": ["error", { object: true, array: false }],
"prefer-template": "error",
"prefer-const": "error",
"no-eval": "error",
"func-style": "error",
"no-loop-func": "error",
"prefer-rest-params": "error",
"no-new-func": "error",
"no-param-reassign": ["error", { props: false }],
"one-var": ["error", "never"],
"no-nested-ternary": "error",
"no-unneeded-ternary": "error",
"import/no-mutable-exports": "error",
"import/prefer-default-export": "error",
"import/first": "error",
"import/extensions": [
"error",
"never",
{ css: "always", svg: "always", md: "always" },
],
"import/no-duplicates": "error",
"no-console": process.env.NODE_ENV === "production" ? "error" : "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "warn",
},
};