forked from windy10v10ai/game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.json
More file actions
60 lines (60 loc) · 1.81 KB
/
Copy path.eslintrc.json
File metadata and controls
60 lines (60 loc) · 1.81 KB
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
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended"
],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".ts", ".jsx", ".tsx"]
}
},
"import/extensions": [".js", ".ts", ".jsx", ".tsx"]
},
"plugins": ["@typescript-eslint", "import", "prettier", "react", "react-hooks"],
"rules": {
"eqeqeq": ["warn", "always", { "null": "ignore" }], // 要求使用 === 和 !==
"consistent-return": "error", // 要求 return 语句要么总是指定返回的值,要么不指定
"prettier/prettier": [
"error",
{
"endOfLine": "auto",
"singleQuote": true // 使用单引号
}
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "@mui/material",
"importNames": ["makeStyles", "createMuiTheme"],
"message": "Please import from @mui/material/styles instead. See https://material-ui.com/guides/minimizing-bundle-size/#option-2 for more information"
}
]
}
],
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"prefer-const": "error",
"no-eval": "error",
"no-redeclare": "off",
"import/no-anonymous-default-export": "off",
"@typescript-eslint/no-redeclare": ["off", {}],
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error"
},
"overrides": [
{
"files": ["*.js"],
"rules": {
"@typescript-eslint/no-require-imports": "off" // 在 JavaScript 文件中禁用该规则
}
}
]
}