-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
109 lines (109 loc) · 3.81 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
// https://eslint.org/docs/rules/
module.exports = {
root: true,
env: {
node: true,
es6: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
sourceType: "module",
project: ["tsconfig.eslint.json"],
},
extends: [
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"plugin:prettier/recommended",
],
ignorePatterns: [
"src/generate/*",
"src/config/Config/*.ts",
"src/common/TEA.ts",
"src/common/TSTea*",
"submodules/AkaShareCode/BattleLogic/*",
"scripts/*",
],
rules: {
"prettier/prettier": [
1,
{
endOfLine: "lf",
printWidth: 130,
tabWidth: 4,
trailingComma: "all",
},
],
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 1,
"import/no-cycle": 0,
"import/no-dynamic-require": 0,
"import/order": [
1,
{
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
alphabetize: { order: "asc", caseInsensitive: true },
},
],
"import/prefer-default-export": 0,
"@typescript-eslint/lines-between-class-members": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-inferrable-types": [1, { ignoreParameters: true, ignoreProperties: true }],
"@typescript-eslint/no-misused-promises": [2, { checksVoidReturn: false }],
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unsafe-argument": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-floating-promises": 0,
"@typescript-eslint/no-use-before-define": [
2,
{
classes: false,
functions: false,
enums: false,
typedefs: false,
ignoreTypeReferences: true,
},
],
"@typescript-eslint/require-await": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/restrict-template-expressions": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-unsafe-return": 0,
"global-require": 0,
"no-console": 0,
"no-constant-condition": 0,
"object-shorthand": 0,
"class-methods-use-this": 0,
"comma-dangle": [1, "always-multiline"], // 尾部的","
"eol-last": 1, // 文件后的空行
eqeqeq: [2, "smart"],
"lines-between-class-members": [1, "always", { exceptAfterSingleLine: true }], // Class属性间的换行
"max-classes-per-file": 0,
"no-await-in-loop": 0,
"no-continue": 0,
"no-param-reassign": 0,
"no-plusplus": 0,
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"no-unused-vars": 0, // 禁止未使用变量
"no-var": 2, // 禁止var
"no-void": 0,
"prefer-const": 2, // 尽量使用const
"prefer-destructuring": 0,
"prefer-template": 1,
"quote-props": [2, "as-needed"], // 属性的引号
"no-empty": 0,
"prefer-exponentiation-operator": 0, // Math.pow ==> **
"no-restricted-properties": 0, // Math.pow ==> **
"no-bitwise": 0,
radix: [1, "as-needed"],
"func-names": 0,
},
};