@typescript-eslint/eslint-plugin 8.0.0-alpha.48 → 8.0.0-alpha.49
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/rules/consistent-type-imports.js +10 -11
- package/dist/rules/consistent-type-imports.js.map +1 -1
- package/dist/rules/no-mixed-enums.js +6 -9
- package/dist/rules/no-mixed-enums.js.map +1 -1
- package/dist/rules/no-non-null-assertion.js +12 -14
- package/dist/rules/no-non-null-assertion.js.map +1 -1
- package/dist/rules/no-unnecessary-condition.js +8 -6
- package/dist/rules/no-unnecessary-condition.js.map +1 -1
- package/dist/rules/no-unsafe-return.js +2 -1
- package/dist/rules/no-unsafe-return.js.map +1 -1
- package/dist/rules/no-unused-vars.js +10 -12
- package/dist/rules/no-unused-vars.js.map +1 -1
- package/dist/rules/prefer-optional-chain-utils/analyzeChain.js +31 -35
- package/dist/rules/prefer-optional-chain-utils/analyzeChain.js.map +1 -1
- package/dist/rules/return-await.js +71 -58
- package/dist/rules/return-await.js.map +1 -1
- package/dist/rules/strict-boolean-expressions.js +101 -1
- package/dist/rules/strict-boolean-expressions.js.map +1 -1
- package/dist/util/getFunctionHeadLoc.js +2 -2
- package/dist/util/getFunctionHeadLoc.js.map +1 -1
- package/docs/rules/return-await.mdx +73 -11
- package/docs/rules/strict-boolean-expressions.mdx +6 -0
- package/package.json +7 -7
@@ -21,6 +21,7 @@ The following nodes are considered boolean expressions and their type is checked
|
|
21
21
|
- Operands of logical binary operators (`lhs || rhs` and `lhs && rhs`).
|
22
22
|
- Right-hand side operand is ignored when it's not a descendant of another boolean expression.
|
23
23
|
This is to allow usage of boolean operators for their short-circuiting behavior.
|
24
|
+
- Asserted argument of an assertion function (`assert(arg)`).
|
24
25
|
|
25
26
|
## Examples
|
26
27
|
|
@@ -55,6 +56,11 @@ let obj = {};
|
|
55
56
|
while (obj) {
|
56
57
|
obj = getObj();
|
57
58
|
}
|
59
|
+
|
60
|
+
// assertion functions without an `is` are boolean contexts.
|
61
|
+
declare function assert(value: unknown): asserts value;
|
62
|
+
let maybeString = Math.random() > 0.5 ? '' : undefined;
|
63
|
+
assert(maybeString);
|
58
64
|
```
|
59
65
|
|
60
66
|
</TabItem>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
3
|
-
"version": "8.0.0-alpha.
|
3
|
+
"version": "8.0.0-alpha.49",
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -60,10 +60,10 @@
|
|
60
60
|
},
|
61
61
|
"dependencies": {
|
62
62
|
"@eslint-community/regexpp": "^4.10.0",
|
63
|
-
"@typescript-eslint/scope-manager": "8.0.0-alpha.
|
64
|
-
"@typescript-eslint/type-utils": "8.0.0-alpha.
|
65
|
-
"@typescript-eslint/utils": "8.0.0-alpha.
|
66
|
-
"@typescript-eslint/visitor-keys": "8.0.0-alpha.
|
63
|
+
"@typescript-eslint/scope-manager": "8.0.0-alpha.49",
|
64
|
+
"@typescript-eslint/type-utils": "8.0.0-alpha.49",
|
65
|
+
"@typescript-eslint/utils": "8.0.0-alpha.49",
|
66
|
+
"@typescript-eslint/visitor-keys": "8.0.0-alpha.49",
|
67
67
|
"graphemer": "^1.4.0",
|
68
68
|
"ignore": "^5.3.1",
|
69
69
|
"natural-compare": "^1.4.0",
|
@@ -74,8 +74,8 @@
|
|
74
74
|
"@types/marked": "^5.0.2",
|
75
75
|
"@types/mdast": "^4.0.3",
|
76
76
|
"@types/natural-compare": "*",
|
77
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.0.0-alpha.
|
78
|
-
"@typescript-eslint/rule-tester": "8.0.0-alpha.
|
77
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.0.0-alpha.49",
|
78
|
+
"@typescript-eslint/rule-tester": "8.0.0-alpha.49",
|
79
79
|
"ajv": "^6.12.6",
|
80
80
|
"cross-env": "^7.0.3",
|
81
81
|
"cross-fetch": "*",
|