-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
98 lines (96 loc) · 2.57 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
/*
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-eslint eslint eslint-config-prettier eslint-plugin-cypress eslint-plugin-prettier prettier husky lint-staged -D
package.json:
"scripts":{
"eslint": "eslint --ext .tsx,.ts,.js --cache --fix ./"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"./{src,server}/++/+.{ts,tsx,js}": [
"npm run eslint"
]
},
*/
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
"jest/globals": true,
},
extends: [
"plugin:cypress/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 11,
sourceType: "module",
},
plugins: ["prettier", "@typescript-eslint", "jest"],
globals: {
$: true,
test: true,
},
rules: {
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"prettier/prettier": 1,
"no-empty": 0,
"no-constant-condition": 0,
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"no-console": [
"warn",
{
allow: ["warn", "error"],
},
],
eqeqeq: ["warn", "always"],
"prefer-const": [
"error",
{
destructuring: "all",
ignoreReadBeforeAssign: true,
},
],
"cypress/no-assigning-return-values": "error",
"cypress/no-unnecessary-waiting": 0,
"cypress/assertion-before-screenshot": "warn",
"cypress/no-force": 0,
"cypress/no-async-tests": "error",
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/indent": 0,
// "@typescript-eslint/indent": [
// "error",
// 2,
// {
// VariableDeclarator: 4,
// SwitchCase: 1,
// },
// ],
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/no-triple-slash-reference": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/triple-slash-reference": 0,
},
};