eslint-plugin-react-x 1.17.4-beta.0 → 1.17.4-beta.4

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 CHANGED
@@ -10,7 +10,6 @@ var tsPattern = require('ts-pattern');
10
10
  var VAR = require('@eslint-react/var');
11
11
  var typeUtils = require('@typescript-eslint/type-utils');
12
12
  var utils = require('@typescript-eslint/utils');
13
- var astUtils = require('@typescript-eslint/utils/ast-utils');
14
13
  var compareVersions = require('compare-versions');
15
14
  var ts = require('typescript');
16
15
  var isImmutableType = require('is-immutable-type');
@@ -42,7 +41,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
42
41
 
43
42
  // package.json
44
43
  var name = "eslint-plugin-react-x";
45
- var version = "1.17.4-beta.0";
44
+ var version = "1.17.4-beta.4";
46
45
  var createRule = shared.createRuleForPlugin("x");
47
46
 
48
47
  // src/rules/avoid-shorthand-boolean.ts
@@ -1300,7 +1299,7 @@ var no_leaked_conditional_rendering_default = createRule({
1300
1299
  const isLeftUnaryNot = tsPattern.isMatching({ type: types.AST_NODE_TYPES.UnaryExpression, operator: "!" }, left);
1301
1300
  if (isLeftUnaryNot) return getReportDescriptor(right);
1302
1301
  const initialScope = context.sourceCode.getScope(left);
1303
- const isLeftNan = tsPattern.isMatching({ type: types.AST_NODE_TYPES.Identifier, name: "NaN" }, left) || astUtils.getStaticValue(left, initialScope)?.value === "NaN";
1302
+ const isLeftNan = tsPattern.isMatching({ type: types.AST_NODE_TYPES.Identifier, name: "NaN" }, left) || tools.O.exists(VAR__namespace.getStaticValue(left, initialScope), (v) => v === "NaN");
1304
1303
  if (isLeftNan) {
1305
1304
  return tools.O.some({
1306
1305
  messageId: "noLeakedConditionalRendering",
package/dist/index.mjs CHANGED
@@ -8,14 +8,13 @@ import { isMatching, P, match } from 'ts-pattern';
8
8
  import * as VAR from '@eslint-react/var';
9
9
  import { getConstrainedTypeAtLocation, isTypeReadonly } from '@typescript-eslint/type-utils';
10
10
  import { ESLintUtils } from '@typescript-eslint/utils';
11
- import { getStaticValue } from '@typescript-eslint/utils/ast-utils';
12
11
  import { compare } from 'compare-versions';
13
12
  import ts from 'typescript';
14
13
  import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReadonlyDeep } from 'is-immutable-type';
15
14
 
16
15
  // package.json
17
16
  var name = "eslint-plugin-react-x";
18
- var version = "1.17.4-beta.0";
17
+ var version = "1.17.4-beta.4";
19
18
  var createRule = createRuleForPlugin("x");
20
19
 
21
20
  // src/rules/avoid-shorthand-boolean.ts
@@ -1273,7 +1272,7 @@ var no_leaked_conditional_rendering_default = createRule({
1273
1272
  const isLeftUnaryNot = isMatching({ type: AST_NODE_TYPES.UnaryExpression, operator: "!" }, left);
1274
1273
  if (isLeftUnaryNot) return getReportDescriptor(right);
1275
1274
  const initialScope = context.sourceCode.getScope(left);
1276
- const isLeftNan = isMatching({ type: AST_NODE_TYPES.Identifier, name: "NaN" }, left) || getStaticValue(left, initialScope)?.value === "NaN";
1275
+ const isLeftNan = isMatching({ type: AST_NODE_TYPES.Identifier, name: "NaN" }, left) || O.exists(VAR.getStaticValue(left, initialScope), (v) => v === "NaN");
1277
1276
  if (isLeftNan) {
1278
1277
  return O.some({
1279
1278
  messageId: "noLeakedConditionalRendering",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.17.4-beta.0",
3
+ "version": "1.17.4-beta.4",
4
4
  "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -49,13 +49,13 @@
49
49
  "compare-versions": "^6.1.1",
50
50
  "is-immutable-type": "^5.0.0",
51
51
  "ts-pattern": "^5.5.0",
52
- "@eslint-react/ast": "1.17.4-beta.0",
53
- "@eslint-react/core": "1.17.4-beta.0",
54
- "@eslint-react/tools": "1.17.4-beta.0",
55
- "@eslint-react/types": "1.17.4-beta.0",
56
- "@eslint-react/shared": "1.17.4-beta.0",
57
- "@eslint-react/var": "1.17.4-beta.0",
58
- "@eslint-react/jsx": "1.17.4-beta.0"
52
+ "@eslint-react/ast": "1.17.4-beta.4",
53
+ "@eslint-react/core": "1.17.4-beta.4",
54
+ "@eslint-react/jsx": "1.17.4-beta.4",
55
+ "@eslint-react/shared": "1.17.4-beta.4",
56
+ "@eslint-react/tools": "1.17.4-beta.4",
57
+ "@eslint-react/types": "1.17.4-beta.4",
58
+ "@eslint-react/var": "1.17.4-beta.4"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^18.3.12",