eslint-plugin-react-x 1.26.3-next.10 → 1.26.3-next.11
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 +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
42
42
|
|
|
43
43
|
// package.json
|
|
44
44
|
var name = "eslint-plugin-react-x";
|
|
45
|
-
var version = "1.26.3-next.
|
|
45
|
+
var version = "1.26.3-next.11";
|
|
46
46
|
var createRule = shared.createRuleForPlugin("x");
|
|
47
47
|
|
|
48
48
|
// src/utils/get-associated-tokens.ts
|
|
@@ -279,7 +279,7 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
279
279
|
if (setState == null || hasThisState) {
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
if (
|
|
282
|
+
if (node.init == null || !AST11__namespace.isThisExpression(node.init) || node.id.type !== types.AST_NODE_TYPES.ObjectPattern) {
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
285
|
const hasState = node.id.properties.some(
|
|
@@ -2809,7 +2809,7 @@ var no_unused_state_default = createRule({
|
|
|
2809
2809
|
if (!currentClass.body.body.includes(currentMethod)) {
|
|
2810
2810
|
return;
|
|
2811
2811
|
}
|
|
2812
|
-
if (
|
|
2812
|
+
if (node.init == null || !AST11__namespace.isThisExpression(node.init) || node.id.type !== types.AST_NODE_TYPES.ObjectPattern) {
|
|
2813
2813
|
return;
|
|
2814
2814
|
}
|
|
2815
2815
|
const hasState = node.id.properties.some((prop) => {
|
|
@@ -2926,7 +2926,7 @@ function trimLikeReact(text) {
|
|
|
2926
2926
|
}
|
|
2927
2927
|
function checkAndReport(node, context, allowExpressions) {
|
|
2928
2928
|
function fix(fixer) {
|
|
2929
|
-
if (
|
|
2929
|
+
if (node.parent.type !== types.AST_NODE_TYPES.JSXElement && node.parent.type !== types.AST_NODE_TYPES.JSXFragment) {
|
|
2930
2930
|
if (node.children.length === 0) {
|
|
2931
2931
|
return null;
|
|
2932
2932
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
17
|
var name = "eslint-plugin-react-x";
|
|
18
|
-
var version = "1.26.3-next.
|
|
18
|
+
var version = "1.26.3-next.11";
|
|
19
19
|
var createRule = createRuleForPlugin("x");
|
|
20
20
|
|
|
21
21
|
// src/utils/get-associated-tokens.ts
|
|
@@ -252,7 +252,7 @@ var no_access_state_in_setstate_default = createRule({
|
|
|
252
252
|
if (setState == null || hasThisState) {
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
255
|
+
if (node.init == null || !AST11.isThisExpression(node.init) || node.id.type !== AST_NODE_TYPES.ObjectPattern) {
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
const hasState = node.id.properties.some(
|
|
@@ -2782,7 +2782,7 @@ var no_unused_state_default = createRule({
|
|
|
2782
2782
|
if (!currentClass.body.body.includes(currentMethod)) {
|
|
2783
2783
|
return;
|
|
2784
2784
|
}
|
|
2785
|
-
if (
|
|
2785
|
+
if (node.init == null || !AST11.isThisExpression(node.init) || node.id.type !== AST_NODE_TYPES.ObjectPattern) {
|
|
2786
2786
|
return;
|
|
2787
2787
|
}
|
|
2788
2788
|
const hasState = node.id.properties.some((prop) => {
|
|
@@ -2899,7 +2899,7 @@ function trimLikeReact(text) {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
function checkAndReport(node, context, allowExpressions) {
|
|
2901
2901
|
function fix(fixer) {
|
|
2902
|
-
if (
|
|
2902
|
+
if (node.parent.type !== AST_NODE_TYPES.JSXElement && node.parent.type !== AST_NODE_TYPES.JSXFragment) {
|
|
2903
2903
|
if (node.children.length === 0) {
|
|
2904
2904
|
return null;
|
|
2905
2905
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.26.3-next.
|
|
3
|
+
"version": "1.26.3-next.11",
|
|
4
4
|
"description": "A set of composable linting rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.6.2",
|
|
53
|
-
"@eslint-react/ast": "1.26.3-next.
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/jsx": "1.26.3-next.
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.26.3-next.11",
|
|
54
|
+
"@eslint-react/eff": "1.26.3-next.11",
|
|
55
|
+
"@eslint-react/core": "1.26.3-next.11",
|
|
56
|
+
"@eslint-react/jsx": "1.26.3-next.11",
|
|
57
|
+
"@eslint-react/shared": "1.26.3-next.11",
|
|
58
|
+
"@eslint-react/var": "1.26.3-next.11"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.8",
|