-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.eslintrc.js
94 lines (92 loc) · 2.47 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
const path = require("path");
const developmentEnv = process.env.NODE_ENV === "development";
module.exports = {
parser: "babel-eslint",
extends: ["airbnb", "prettier", "prettier/react"],
plugins: ["react", "prettier", "react-hooks", "import"],
rules: {
"react/jsx-filename-extension": [
1,
{
extensions: [".js", "jsx"]
}
],
"id-length": ["error", { min: 1 }],
"import/first": 2,
"import/exports-last": 2,
"import/newline-after-import": 2,
"import/no-duplicates": 2,
"import/no-namespace": 2,
"import/no-named-default": 2,
"import/order": [
"error",
{
groups: ["builtin", "external", "parent", "sibling", "index"],
"newlines-between": "always"
}
],
"import/prefer-default-export": 1,
"no-debugger": developmentEnv ? "off" : "error",
"no-underscore-dangle": "off",
"no-unexpected-multiline": "off",
"max-len": ["error", { code: 120 }],
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: ["const", "let", "var"], next: "*" },
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"]
},
{ blankLine: "always", prev: "*", next: "return" },
{ blankLine: "always", prev: "directive", next: "*" },
{ blankLine: "any", prev: "directive", next: "directive" }
],
"prettier/prettier": "error",
"react/display-name": ["error", { ignoreTranspilerName: true }],
"react/forbid-prop-types": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-sort-default-props": [
"error",
{
ignoreCase: true
}
],
"react/no-multi-comp": "warn",
"react/require-default-props": "off",
"react-hooks/exhaustive-deps": "off",
"react-hooks/rules-of-hooks": "error",
"react/sort-prop-types": "error",
"import/no-extraneous-dependencies": "off"
},
env: {
browser: true
},
overrides: [{
"files": ["*.unit.test.js"],
"env": {
"mocha": true
},
"globals": {
"expect": "readonly"
},
"rules": {
"import/no-namespace": "off",
"no-unused-expressions": "off",
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "should|expect"
}
],
"react/display-name": "off",
"react/no-multi-comp": "off",
"react/prop-types": "off"
}
}, {
"files": ["worker.js"],
"globals": {
"workbox": "readonly"
}
}]
};