eslint-plugin-react-x 1.52.3-next.10 → 1.52.3-next.2
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/README.md +1 -1
- package/dist/index.js +15 -10
- package/dist/index.mjs +16 -11
- package/package.json +12 -12
package/README.md
CHANGED
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-next.
|
|
145
|
+
var version = "1.52.3-next.2";
|
|
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
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
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,
|
|
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-next.
|
|
118
|
+
var version = "1.52.3-next.2";
|
|
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
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.52.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.52.3-next.2",
|
|
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",
|
|
7
7
|
"eslint",
|
|
@@ -42,20 +42,20 @@
|
|
|
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.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-next.
|
|
54
|
-
"@eslint-react/core": "1.52.3-next.
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.52.3-next.2",
|
|
54
|
+
"@eslint-react/core": "1.52.3-next.2",
|
|
55
|
+
"@eslint-react/eff": "1.52.3-next.2",
|
|
56
|
+
"@eslint-react/var": "1.52.3-next.2",
|
|
57
|
+
"@eslint-react/kit": "1.52.3-next.2",
|
|
58
|
+
"@eslint-react/shared": "1.52.3-next.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.8",
|