tsl-react 0.0.3-next.8 → 0.0.4-next.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.
Files changed (2) hide show
  1. package/dist/index.js +3 -5
  2. package/package.json +7 -8
package/dist/index.js CHANGED
@@ -4,8 +4,7 @@ import { SyntaxKind } from "typescript";
4
4
  import { isLogicalNegationExpression } from "@react-analyzer/ast";
5
5
  import * as RA from "@react-analyzer/core";
6
6
  import { unit } from "@react-analyzer/eff";
7
- import { Report } from "@react-analyzer/kit";
8
- import { getAnalyzerOptions } from "@react-analyzer/shared";
7
+ import { getAnalyzerOptions, report } from "@react-analyzer/shared";
9
8
 
10
9
  //#region src/rules/no-leaked-conditional-rendering.ts
11
10
  /** @internal */
@@ -83,8 +82,7 @@ const noLeakedConditionalRendering = defineRule(() => {
83
82
  if (isLogicalNegationExpression(node.left)) return unit;
84
83
  const leftType = ctx.utils.getConstrainedTypeAtLocation(node.left);
85
84
  const leftTypeVariants = RA.getVariantsOfTypes(ctx.utils.unionConstituents(leftType));
86
- const areAllLeftTypeVariantsAllowed = Array.from(leftTypeVariants.values()).every((type) => allowedVariants.some((allowed) => allowed === type));
87
- if (!areAllLeftTypeVariantsAllowed) return {
85
+ if (!Array.from(leftTypeVariants.values()).every((type) => allowedVariants.some((allowed) => allowed === type))) return {
88
86
  node: node.left,
89
87
  message: messages.noLeakedConditionalRendering({ value: node.left.getText() })
90
88
  };
@@ -108,7 +106,7 @@ const noLeakedConditionalRendering = defineRule(() => {
108
106
  const { state, getReportDescriptor } = ctx.data;
109
107
  if (!state.isWithinJsxExpression) return;
110
108
  if (node.operatorToken.kind !== SyntaxKind.AmpersandAmpersandToken) return;
111
- Report.report(ctx, getReportDescriptor(node));
109
+ report(ctx, getReportDescriptor(node));
112
110
  }
113
111
  }
114
112
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsl-react",
3
- "version": "0.0.3-next.8",
3
+ "version": "0.0.4-next.1",
4
4
  "description": "A unified plugin that combines all individual plugins from the react-analyzer monorepo into one.",
5
5
  "keywords": [
6
6
  "react",
@@ -28,18 +28,17 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "compare-versions": "^6.1.1",
31
- "@react-analyzer/ast": "0.0.3-next.8",
32
- "@react-analyzer/core": "0.0.3-next.8",
33
- "@react-analyzer/eff": "0.0.3-next.8",
34
- "@react-analyzer/kit": "0.0.3-next.8",
35
- "@react-analyzer/shared": "0.0.3-next.8"
31
+ "@react-analyzer/ast": "0.0.4-next.1",
32
+ "@react-analyzer/core": "0.0.4-next.1",
33
+ "@react-analyzer/eff": "0.0.4-next.1",
34
+ "@react-analyzer/shared": "0.0.4-next.1"
36
35
  },
37
36
  "devDependencies": {
38
- "tsdown": "^0.14.2",
37
+ "tsdown": "^0.15.9",
39
38
  "@local/configs": "0.0.0"
40
39
  },
41
40
  "peerDependencies": {
42
- "tsl": "^1.0.22",
41
+ "tsl": "^1.0.25",
43
42
  "typescript": "^4.9.5 || ^5.4.5"
44
43
  },
45
44
  "engines": {