tsl-react 0.0.10 → 0.0.11
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 +2 -3
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { unit } from "@local/eff";
|
|
2
1
|
import { isLogicalNegationExpression } from "@react-analyzer/ast";
|
|
3
2
|
import { getAnalyzerOptions, report } from "@react-analyzer/shared";
|
|
4
3
|
import { compare } from "compare-versions";
|
|
@@ -173,14 +172,14 @@ const noLeakedConditionalRendering = defineRule(() => {
|
|
|
173
172
|
...compare(version, "18.0.0", "<") ? [] : ["string", "falsy string"]
|
|
174
173
|
];
|
|
175
174
|
function getReportDescriptor(node) {
|
|
176
|
-
if (isLogicalNegationExpression(node.left)) return
|
|
175
|
+
if (isLogicalNegationExpression(node.left)) return null;
|
|
177
176
|
const leftType = ctx.utils.getConstrainedTypeAtLocation(node.left);
|
|
178
177
|
const leftTypeVariants = getTypeVariants(ctx.utils.unionConstituents(leftType));
|
|
179
178
|
if (!Array.from(leftTypeVariants.values()).every((type) => allowedVariants.some((allowed) => allowed === type))) return {
|
|
180
179
|
node: node.left,
|
|
181
180
|
message: messages.noLeakedConditionalRendering({ value: node.left.getText() })
|
|
182
181
|
};
|
|
183
|
-
return
|
|
182
|
+
return null;
|
|
184
183
|
}
|
|
185
184
|
return {
|
|
186
185
|
state,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsl-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "A unified plugin that combines all individual plugins from the react-analyzer monorepo into one.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"compare-versions": "^6.1.1",
|
|
31
31
|
"ts-pattern": "^5.9.0",
|
|
32
|
-
"@
|
|
33
|
-
"@react-analyzer/
|
|
34
|
-
"@
|
|
35
|
-
"@react-analyzer/
|
|
32
|
+
"@local/eff": "0.0.11",
|
|
33
|
+
"@react-analyzer/core": "0.0.11",
|
|
34
|
+
"@react-analyzer/ast": "0.0.11",
|
|
35
|
+
"@react-analyzer/shared": "0.0.11"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"tsdown": "^0.
|
|
39
|
-
"@local/configs": "0.0.
|
|
38
|
+
"tsdown": "^0.21.0-beta.2",
|
|
39
|
+
"@local/configs": "0.0.11"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"tsl": "^1.0.
|
|
42
|
+
"tsl": "^1.0.29",
|
|
43
43
|
"typescript": "^4.9.5 || ^5.4.5"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|