|
9 | 9 | "rules": { |
10 | 10 | "adjacent-overload-signatures": true, |
11 | 11 | "align": [true, "members", "parameters", "statements"], |
12 | | - "array-bracket-spacing": [true, "never", {"singleValue": false, "objectsInArrays": true, "arraysInArrays": true} ], // 设置在括号内使用空格风格 |
| 12 | + "array-bracket-spacing": [true, "never", {"singleValue": false, "objectsInArrays": true, "arraysInArrays": true} ], |
13 | 13 | "arrow-parens": [true, "ban-single-arg-parens"], |
14 | | - "await-promise": [true, "Thenable"], // Warns for an awaited value that is not a Promise. |
| 14 | + "await-promise": [true, "Thenable"], |
15 | 15 | "ban-comma-operator": true, |
16 | | - "block-spacing": [true, "always"], // 强制在单行代码块中使用一致的空格 |
17 | | - "brace-style": [true, "stroustrup", { "allowSingleLine": true }], // 大括号风格要求 |
18 | | - "comment-format": [true, "check-space", {"ignore-words": ["-", "+"]}], // 强制在注释中 // 或 /* 使用一致的空格 |
19 | | - "curly": [true, "ignore-same-line"], // 要求遵循大括号约定 |
| 16 | + "block-spacing": [true, "always"], |
| 17 | + "brace-style": [true, "stroustrup", { "allowSingleLine": true }], |
| 18 | + "comment-format": [true, "check-space", {"ignore-words": ["-", "+"]}], |
| 19 | + "curly": [true, "ignore-same-line"], |
20 | 20 | "eofline": true, |
21 | 21 | "forin": false, |
22 | 22 | "import-blacklist": [ |
|
43 | 43 | ]}], |
44 | 44 | "no-arg": true, |
45 | 45 | "no-angle-bracket-type-assertion": false, |
46 | | - "no-consecutive-blank-lines": [true, 4], // 多个空行控制 |
| 46 | + "no-consecutive-blank-lines": [true, 4], |
47 | 47 | "no-console": [ true, "dir", "log", "warn" ], |
48 | | - "no-construct": true, // 禁止对 String,Number 和 Boolean 使用 new 操作符 |
| 48 | + "no-construct": true, |
49 | 49 | "no-control-regex": true, |
50 | 50 | "no-duplicate-variable": true, |
51 | | - "no-duplicate-imports": true, // 禁止单个模块多次导入 |
| 51 | + "no-duplicate-imports": true, |
52 | 52 | "no-duplicate-switch-case": true, |
53 | | - "no-empty": false, // 禁止空块语句 |
| 53 | + "no-empty": false, |
54 | 54 | "no-extra-semi": true, |
55 | 55 | "no-eval": true, |
56 | 56 | "no-implicit-dependencies": [true, "dev"], |
57 | | - "no-multi-spaces": [ true, { "exceptions": { "PropertyAssignment": true, "VariableDeclaration": false } } ] , // 禁止出现多个空格 |
| 57 | + "no-multi-spaces": [ true, { "exceptions": { "PropertyAssignment": true, "VariableDeclaration": false } } ], |
58 | 58 | "no-object-literal-type-assertion": false, |
59 | | - "no-parameter-reassignment": false, // 禁止参数变量重新赋值 |
| 59 | + "no-parameter-reassignment": false, |
60 | 60 | "no-return-await": true, |
61 | | - "no-reference": true, // Disallows /// <reference path=> imports (use ES6-style imports instead). |
| 61 | + "no-reference": true, |
62 | 62 | "no-shadowed-variable": [ |
63 | 63 | true, |
64 | 64 | { |
|
77 | 77 | "@angular/platform-browser", |
78 | 78 | "source-map-support/register" |
79 | 79 | ], |
80 | | - "no-trailing-whitespace": [true, "ignore-comments"], // 禁用行尾空白 |
81 | | - "no-unnecessary-initializer": true, // 禁止变量赋值为 undefined |
| 80 | + "no-trailing-whitespace": [true, "ignore-comments"], |
| 81 | + "no-unnecessary-initializer": true, |
82 | 82 | "no-unused-expression": [true, "allow-fast-null-checks"], |
83 | 83 | "no-unused-variable": { |
84 | 84 | "severity": "warning", |
85 | 85 | "options": [true, { "ignore-pattern": "^_" }] |
86 | 86 | }, |
87 | 87 | "no-unnecessary-type-assertion": false, |
88 | | - "no-use-before-declare": true, // 禁止在变量定义之前使用它们 |
89 | | - "no-var-keyword": true, // 要求使用 let 或 const 而不是 var |
90 | | - "no-var-requires": true, // Disallows the use of require statements except in import statements. |
91 | | - "object-curly-spacing": [true, "always"], // 强制在大括号中使用一致的空格 |
| 88 | + "no-use-before-declare": true, |
| 89 | + "no-var-keyword": true, |
| 90 | + "no-var-requires": true, |
| 91 | + "object-curly-spacing": [true, "always"], |
92 | 92 | "object-literal-shorthand": [true], |
93 | 93 | "object-literal-sort-keys": false, |
94 | 94 | "one-line": [true, "check-open-brace", "check-whitespace"], |
|
108 | 108 | true, |
109 | 109 | {"anonymous": "always", "named": "never"} |
110 | 110 | ], |
111 | | - "ter-arrow-spacing": [true, { "before": true, "after": true }], // 要求箭头函数的箭头之前或之后有空格 |
112 | | - "ter-func-call-spacing": [true, "never"], // disallow spacing between function identifiers and their invocations |
| 111 | + "ter-arrow-spacing": [true, { "before": true, "after": true }], |
| 112 | + "ter-func-call-spacing": [true, "never"], |
113 | 113 | "ter-indent": [true, 2, |
114 | 114 | { |
115 | 115 | "SwitchCase": 1 |
116 | 116 | } |
117 | 117 | ], |
118 | | - "ter-no-irregular-whitespace": true, // 禁止不规则的空白 |
| 118 | + "ter-no-irregular-whitespace": true, |
119 | 119 | "trailing-comma": [true, |
120 | 120 | { |
121 | 121 | "multiline": { |
|
129 | 129 | "singleline": "never", |
130 | 130 | "esSpecCompliant": true |
131 | 131 | } |
132 | | - ], // 当最后一个元素或属性与闭括号 ] 或 右大括号 在 不同的行时,要求使用拖尾逗号;当在 同一行时,禁止使用拖尾逗号 |
| 132 | + ], |
133 | 133 | "triple-equals": true, |
134 | | - "use-isnan": true, // 要求使用 isNaN() 检查 NaN |
135 | | - "valid-typeof": true, // 强制 typeof 表达式与有效的字符串进行比较 |
| 134 | + "use-isnan": true, |
| 135 | + "valid-typeof": true, |
136 | 136 | "variable-name": [true, "ban-keywords", "allow-leading-underscore"], |
137 | 137 | "whitespace": { |
138 | 138 | "options": [true, |
|
0 commit comments