forked from waitingsong/node-win32-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
58 lines (58 loc) · 1.99 KB
/
.eslintrc.json
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
{
"env": {
"amd": true,
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true,
"jest": true,
"mocha": true,
"node": true,
"serviceworker": true,
"worker": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": "eslint:recommended",
"globals": {
},
"rules": {
"linebreak-style": [ 2, "unix" ],
"semi": [ 1, "never", {"beforeStatementContinuationChars": "always"} ],
"quotes": [ 2, "single" ],
"no-unused-vars": 0,
"no-mixed-spaces-and-tabs": [2],
"no-use-before-define": [2, {"functions": false, "classes": true }], // 禁止在变量定义之前使用它们
"curly": 2, // 要求遵循大括号约定
"padding-line-between-statements": [ // 变量声明后空格
"warn",
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]}
],
"eol-last": [1, "always"],
"unicode-bom": [2, "never"], // 禁止使用 Unicode 字节顺序标记 (BOM)
"no-new-wrappers": 2, // 禁止对 String,Number 和 Boolean 使用 new 操作符
"no-useless-escape": 2, // 禁用不必要的转义字符
"no-new-object": 2, // 禁止使用 Object 构造函数 new Object, 使用{}替代
"no-delete-var": 2, // 禁止删除变量
"no-label-var": 2, // 禁用与变量同名的标签
"use-isnan": 2, // 要求使用 isNaN() 检查 NaN
"no-caller": 2,
"no-octal-escape": 2,
"no-return-assign": 2,
"no-return-await": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-throw-literal": 2,
"no-unmodified-loop-condition": 2,
"no-array-constructor": 1, // for let foo = <T> new Array()
"no-confusing-arrow": ["error", {"allowParens": true}],
"no-duplicate-imports": 2,
"no-useless-computed-key": 0, // 0 for destructuring assignment
"no-useless-constructor": 2,
"no-useless-rename": 2,
"no-console": 0
}
}