tsl-react 0.0.4-next.2 → 0.0.4-next.6
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/index.js +3 -3
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { compare } from "compare-versions";
|
|
2
2
|
import { defineRule } from "tsl";
|
|
3
3
|
import { SyntaxKind } from "typescript";
|
|
4
|
+
import { unit } from "@let/eff";
|
|
4
5
|
import { isLogicalNegationExpression } from "@react-analyzer/ast";
|
|
5
|
-
import
|
|
6
|
-
import { unit } from "@react-analyzer/eff";
|
|
6
|
+
import { getVariantsOfTypes } from "@react-analyzer/core";
|
|
7
7
|
import { getAnalyzerOptions, report } from "@react-analyzer/shared";
|
|
8
8
|
|
|
9
9
|
//#region src/rules/no-leaked-conditional-rendering.ts
|
|
@@ -81,7 +81,7 @@ const noLeakedConditionalRendering = defineRule(() => {
|
|
|
81
81
|
function getReportDescriptor(node) {
|
|
82
82
|
if (isLogicalNegationExpression(node.left)) return unit;
|
|
83
83
|
const leftType = ctx.utils.getConstrainedTypeAtLocation(node.left);
|
|
84
|
-
const leftTypeVariants =
|
|
84
|
+
const leftTypeVariants = getVariantsOfTypes(ctx.utils.unionConstituents(leftType));
|
|
85
85
|
if (!Array.from(leftTypeVariants.values()).every((type) => allowedVariants.some((allowed) => allowed === type))) return {
|
|
86
86
|
node: node.left,
|
|
87
87
|
message: messages.noLeakedConditionalRendering({ value: node.left.getText() })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsl-react",
|
|
3
|
-
"version": "0.0.4-next.
|
|
3
|
+
"version": "0.0.4-next.6",
|
|
4
4
|
"description": "A unified plugin that combines all individual plugins from the react-analyzer monorepo into one.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"./package.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@let/eff": "npm:@jsr/let__eff@^0.0.0",
|
|
30
31
|
"compare-versions": "^6.1.1",
|
|
31
|
-
"@react-analyzer/ast": "0.0.4-next.
|
|
32
|
-
"@react-analyzer/core": "0.0.4-next.
|
|
33
|
-
"@react-analyzer/shared": "0.0.4-next.
|
|
34
|
-
"@react-analyzer/eff": "0.0.4-next.2"
|
|
32
|
+
"@react-analyzer/ast": "0.0.4-next.6",
|
|
33
|
+
"@react-analyzer/core": "0.0.4-next.6",
|
|
34
|
+
"@react-analyzer/shared": "0.0.4-next.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"tsdown": "^0.
|
|
37
|
+
"tsdown": "^0.16.4",
|
|
38
38
|
"@local/configs": "0.0.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"tsl": "^1.0.
|
|
41
|
+
"tsl": "^1.0.26",
|
|
42
42
|
"typescript": "^4.9.5 || ^5.4.5"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|