eslint-plugin-react-x 1.52.3-next.9 → 1.52.4-beta.0
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 +10 -15
- package/dist/index.mjs +11 -16
- package/package.json +14 -15
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.
|
|
145
|
+
var version = "1.52.4-beta.0";
|
|
146
146
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
147
147
|
|
|
148
148
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -1673,20 +1673,15 @@ function inspectVariantTypes(types) {
|
|
|
1673
1673
|
variantTypes.add("nullish");
|
|
1674
1674
|
}
|
|
1675
1675
|
const booleans = types.filter(tsHelpers.isBooleanType);
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
}
|
|
1686
|
-
case booleans.length === 2: {
|
|
1687
|
-
variantTypes.add("boolean");
|
|
1688
|
-
break;
|
|
1689
|
-
}
|
|
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");
|
|
1690
1685
|
}
|
|
1691
1686
|
const strings = types.filter(tsHelpers.isStringType);
|
|
1692
1687
|
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,
|
|
12
|
+
import { unionTypeParts, isTypeFlagSet, isFalseLiteralType, isTrueLiteralType } 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.
|
|
118
|
+
var version = "1.52.4-beta.0";
|
|
119
119
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
120
120
|
|
|
121
121
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -1646,20 +1646,15 @@ function inspectVariantTypes(types) {
|
|
|
1646
1646
|
variantTypes.add("nullish");
|
|
1647
1647
|
}
|
|
1648
1648
|
const booleans = types.filter(tsHelpers.isBooleanType);
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
}
|
|
1659
|
-
case booleans.length === 2: {
|
|
1660
|
-
variantTypes.add("boolean");
|
|
1661
|
-
break;
|
|
1662
|
-
}
|
|
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");
|
|
1663
1658
|
}
|
|
1664
1659
|
const strings = types.filter(tsHelpers.isStringType);
|
|
1665
1660
|
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
|
+
"version": "1.52.4-beta.0",
|
|
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,24 +42,24 @@
|
|
|
42
42
|
"./package.json"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
46
|
-
"@typescript-eslint/type-utils": "^8.
|
|
47
|
-
"@typescript-eslint/types": "^8.
|
|
48
|
-
"@typescript-eslint/utils": "^8.
|
|
45
|
+
"@typescript-eslint/scope-manager": "^8.38.0",
|
|
46
|
+
"@typescript-eslint/type-utils": "^8.38.0",
|
|
47
|
+
"@typescript-eslint/types": "^8.38.0",
|
|
48
|
+
"@typescript-eslint/utils": "^8.38.0",
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
|
-
"ts-pattern": "^5.
|
|
53
|
-
"@eslint-react/ast": "1.52.
|
|
54
|
-
"@eslint-react/core": "1.52.
|
|
55
|
-
"@eslint-react/eff": "1.52.
|
|
56
|
-
"@eslint-react/kit": "1.52.
|
|
57
|
-
"@eslint-react/shared": "1.52.
|
|
58
|
-
"@eslint-react/var": "1.52.
|
|
52
|
+
"ts-pattern": "^5.8.0",
|
|
53
|
+
"@eslint-react/ast": "1.52.4-beta.0",
|
|
54
|
+
"@eslint-react/core": "1.52.4-beta.0",
|
|
55
|
+
"@eslint-react/eff": "1.52.4-beta.0",
|
|
56
|
+
"@eslint-react/kit": "1.52.4-beta.0",
|
|
57
|
+
"@eslint-react/shared": "1.52.4-beta.0",
|
|
58
|
+
"@eslint-react/var": "1.52.4-beta.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/react": "^19.1.
|
|
62
|
-
"@types/react-dom": "^19.1.
|
|
61
|
+
"@types/react": "^19.1.9",
|
|
62
|
+
"@types/react-dom": "^19.1.7",
|
|
63
63
|
"ts-api-utils": "^2.1.0",
|
|
64
64
|
"tsup": "^8.5.0",
|
|
65
65
|
"@local/configs": "0.0.0"
|
|
@@ -81,7 +81,6 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
|
-
"bun": ">=1.0.15",
|
|
85
84
|
"node": ">=18.18.0"
|
|
86
85
|
},
|
|
87
86
|
"publishConfig": {
|