@lsby/eslint-config 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +6 -0
- package/dist/esm/index.js +6 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -98,6 +98,12 @@ var ts\u5B89\u5168\u6027 = {
|
|
|
98
98
|
"@lsby/prefer-let": "error",
|
|
99
99
|
// 永远使用 === 而不是 ==, 在一些情况下能自动修复
|
|
100
100
|
eqeqeq: ["error", "always"],
|
|
101
|
+
// 禁止 if ... else
|
|
102
|
+
// else 表示"除当前条件外的所有可能"
|
|
103
|
+
// 当状态集合未来扩展时, 依然会被包含在else分支里, 导致状态遗漏却无任何报错
|
|
104
|
+
// 应当使用提早返回 或 switch + 穷尽检查
|
|
105
|
+
"no-else-return": "error",
|
|
106
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
101
107
|
// 在除了条件表达式的地方, 使用??而不是||
|
|
102
108
|
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
103
109
|
// 禁止对非布尔值使用取反
|
package/dist/esm/index.js
CHANGED
|
@@ -58,6 +58,12 @@ var ts\u5B89\u5168\u6027 = {
|
|
|
58
58
|
"@lsby/prefer-let": "error",
|
|
59
59
|
// 永远使用 === 而不是 ==, 在一些情况下能自动修复
|
|
60
60
|
eqeqeq: ["error", "always"],
|
|
61
|
+
// 禁止 if ... else
|
|
62
|
+
// else 表示"除当前条件外的所有可能"
|
|
63
|
+
// 当状态集合未来扩展时, 依然会被包含在else分支里, 导致状态遗漏却无任何报错
|
|
64
|
+
// 应当使用提早返回 或 switch + 穷尽检查
|
|
65
|
+
"no-else-return": "error",
|
|
66
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
61
67
|
// 在除了条件表达式的地方, 使用??而不是||
|
|
62
68
|
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
63
69
|
// 禁止对非布尔值使用取反
|