eslint-plugin-react-x 1.52.3-beta.11 → 1.52.3-beta.3

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 (3) hide show
  1. package/dist/index.js +15 -10
  2. package/dist/index.mjs +16 -11
  3. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -142,7 +142,7 @@ var settings3 = {
142
142
 
143
143
  // package.json
144
144
  var name4 = "eslint-plugin-react-x";
145
- var version = "1.52.3-beta.11";
145
+ var version = "1.52.3-beta.3";
146
146
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
147
147
 
148
148
  // src/rules/avoid-shorthand-boolean.ts
@@ -1673,15 +1673,20 @@ function inspectVariantTypes(types) {
1673
1673
  variantTypes.add("nullish");
1674
1674
  }
1675
1675
  const booleans = types.filter(tsHelpers.isBooleanType);
1676
- const boolean0 = booleans[0];
1677
- if (booleans.length === 1 && boolean0 != null) {
1678
- if (tsApiUtils.isFalseLiteralType(boolean0)) {
1679
- variantTypes.add("falsy boolean");
1680
- } else if (tsApiUtils.isTrueLiteralType(boolean0)) {
1681
- variantTypes.add("truthy boolean");
1682
- }
1683
- } else if (booleans.length === 2) {
1684
- variantTypes.add("boolean");
1676
+ switch (true) {
1677
+ case (booleans.length === 1 && booleans[0] != null): {
1678
+ const first = booleans[0];
1679
+ if (tsApiUtils.isTrueLiteralType(first)) {
1680
+ variantTypes.add("truthy boolean");
1681
+ } else if (tsApiUtils.isFalseLiteralType(first)) {
1682
+ variantTypes.add("falsy boolean");
1683
+ }
1684
+ break;
1685
+ }
1686
+ case booleans.length === 2: {
1687
+ variantTypes.add("boolean");
1688
+ break;
1689
+ }
1685
1690
  }
1686
1691
  const strings = types.filter(tsHelpers.isStringType);
1687
1692
  if (strings.length > 0) {
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import * as AST8 from '@eslint-react/ast';
9
9
  import { flow, getOrElseUpdate, constTrue, constFalse, unit } from '@eslint-react/eff';
10
10
  import { compare } from 'compare-versions';
11
11
  import { getConstrainedTypeAtLocation, isTypeReadonly } from '@typescript-eslint/type-utils';
12
- import { unionTypeParts, isTypeFlagSet, isFalseLiteralType, isTrueLiteralType } from 'ts-api-utils';
12
+ import { unionTypeParts, isTypeFlagSet, isTrueLiteralType, isFalseLiteralType } from 'ts-api-utils';
13
13
  import ts from 'typescript';
14
14
  import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReadonlyDeep } from 'is-immutable-type';
15
15
 
@@ -115,7 +115,7 @@ var settings3 = {
115
115
 
116
116
  // package.json
117
117
  var name4 = "eslint-plugin-react-x";
118
- var version = "1.52.3-beta.11";
118
+ var version = "1.52.3-beta.3";
119
119
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
120
120
 
121
121
  // src/rules/avoid-shorthand-boolean.ts
@@ -1646,15 +1646,20 @@ function inspectVariantTypes(types) {
1646
1646
  variantTypes.add("nullish");
1647
1647
  }
1648
1648
  const booleans = types.filter(tsHelpers.isBooleanType);
1649
- const boolean0 = booleans[0];
1650
- if (booleans.length === 1 && boolean0 != null) {
1651
- if (isFalseLiteralType(boolean0)) {
1652
- variantTypes.add("falsy boolean");
1653
- } else if (isTrueLiteralType(boolean0)) {
1654
- variantTypes.add("truthy boolean");
1655
- }
1656
- } else if (booleans.length === 2) {
1657
- variantTypes.add("boolean");
1649
+ switch (true) {
1650
+ case (booleans.length === 1 && booleans[0] != null): {
1651
+ const first = booleans[0];
1652
+ if (isTrueLiteralType(first)) {
1653
+ variantTypes.add("truthy boolean");
1654
+ } else if (isFalseLiteralType(first)) {
1655
+ variantTypes.add("falsy boolean");
1656
+ }
1657
+ break;
1658
+ }
1659
+ case booleans.length === 2: {
1660
+ variantTypes.add("boolean");
1661
+ break;
1662
+ }
1658
1663
  }
1659
1664
  const strings = types.filter(tsHelpers.isStringType);
1660
1665
  if (strings.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.52.3-beta.11",
3
+ "version": "1.52.3-beta.3",
4
4
  "description": "4-7x faster composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -42,20 +42,20 @@
42
42
  "./package.json"
43
43
  ],
44
44
  "dependencies": {
45
- "@typescript-eslint/scope-manager": "^8.35.1",
46
- "@typescript-eslint/type-utils": "^8.35.1",
47
- "@typescript-eslint/types": "^8.35.1",
48
- "@typescript-eslint/utils": "^8.35.1",
45
+ "@typescript-eslint/scope-manager": "^8.34.0",
46
+ "@typescript-eslint/type-utils": "^8.34.0",
47
+ "@typescript-eslint/types": "^8.34.0",
48
+ "@typescript-eslint/utils": "^8.34.0",
49
49
  "compare-versions": "^6.1.1",
50
50
  "is-immutable-type": "^5.0.1",
51
51
  "string-ts": "^2.2.1",
52
52
  "ts-pattern": "^5.7.1",
53
- "@eslint-react/ast": "1.52.3-beta.11",
54
- "@eslint-react/core": "1.52.3-beta.11",
55
- "@eslint-react/eff": "1.52.3-beta.11",
56
- "@eslint-react/var": "1.52.3-beta.11",
57
- "@eslint-react/kit": "1.52.3-beta.11",
58
- "@eslint-react/shared": "1.52.3-beta.11"
53
+ "@eslint-react/ast": "1.52.3-beta.3",
54
+ "@eslint-react/core": "1.52.3-beta.3",
55
+ "@eslint-react/eff": "1.52.3-beta.3",
56
+ "@eslint-react/var": "1.52.3-beta.3",
57
+ "@eslint-react/shared": "1.52.3-beta.3",
58
+ "@eslint-react/kit": "1.52.3-beta.3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.1.8",