eslint-plugin-react-x 2.0.0-next.169 → 2.0.0-next.170

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 -6
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ import { compare } from "compare-versions";
11
11
  import { camelCase } from "string-ts";
12
12
  import { getConstrainedTypeAtLocation, isTypeReadonly } from "@typescript-eslint/type-utils";
13
13
  import { unionConstituents } from "ts-api-utils";
14
+ import { getStaticValue } from "@typescript-eslint/utils/ast-utils";
14
15
  import { getTypeImmutability, isImmutable, isReadonlyDeep, isReadonlyShallow, isUnknown } from "is-immutable-type";
15
16
 
16
17
  //#region rolldown:runtime
@@ -115,7 +116,7 @@ const settings = { ...settings$1 };
115
116
  //#endregion
116
117
  //#region package.json
117
118
  var name = "eslint-plugin-react-x";
118
- var version = "2.0.0-next.169";
119
+ var version = "2.0.0-next.170";
119
120
 
120
121
  //#endregion
121
122
  //#region src/utils/create-rule.ts
@@ -1520,11 +1521,7 @@ function create$38(context) {
1520
1521
  const isLeftUnaryNot = left.type === AST_NODE_TYPES.UnaryExpression && left.operator === "!";
1521
1522
  if (isLeftUnaryNot) return getReportDescriptor(right);
1522
1523
  const initialScope = context.sourceCode.getScope(left);
1523
- const isLeftNan = left.type === AST_NODE_TYPES.Identifier && left.name === "NaN" || VAR.toStaticValue({
1524
- kind: "lazy",
1525
- node: left,
1526
- initialScope
1527
- }).value === "NaN";
1524
+ const isLeftNan = left.type === AST_NODE_TYPES.Identifier && left.name === "NaN" || getStaticValue(left, initialScope)?.value === "NaN";
1528
1525
  if (isLeftNan) return {
1529
1526
  messageId: "noLeakedConditionalRendering",
1530
1527
  node: left,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "2.0.0-next.169",
3
+ "version": "2.0.0-next.170",
4
4
  "description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -42,12 +42,12 @@
42
42
  "is-immutable-type": "^5.0.1",
43
43
  "string-ts": "^2.2.1",
44
44
  "ts-pattern": "^5.8.0",
45
- "@eslint-react/ast": "2.0.0-next.169",
46
- "@eslint-react/core": "2.0.0-next.169",
47
- "@eslint-react/eff": "2.0.0-next.169",
48
- "@eslint-react/kit": "2.0.0-next.169",
49
- "@eslint-react/shared": "2.0.0-next.169",
50
- "@eslint-react/var": "2.0.0-next.169"
45
+ "@eslint-react/ast": "2.0.0-next.170",
46
+ "@eslint-react/core": "2.0.0-next.170",
47
+ "@eslint-react/eff": "2.0.0-next.170",
48
+ "@eslint-react/kit": "2.0.0-next.170",
49
+ "@eslint-react/var": "2.0.0-next.170",
50
+ "@eslint-react/shared": "2.0.0-next.170"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/react": "^19.1.12",