forked from WindRunnerMax/TKScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
37 lines (37 loc) · 1.01 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
module.exports = {
extends: ["eslint:recommended", "plugin:prettier/recommended"],
env: {
browser: true,
node: true,
commonjs: true,
es2021: true,
},
parserOptions: {
requireConfigFile: false,
ecmaVersion: 2020,
sourceType: "module",
},
overrides: [
{
files: ["*.ts"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
},
],
ignorePatterns: ["node_modules", "build", "dist", "coverage"],
rules: {
// 分号
"semi": "error",
// 对象键值引号样式保持一致
"quote-props": ["error", "consistent-as-needed"],
// 箭头函数允许单参数不带括号
"arrow-parens": ["error", "as-needed"],
// no var
"no-var": "error",
// const
"prefer-const": "error",
// 允许console
"no-console": "off",
},
};