eslint-plugin-react-x 5.9.2 → 5.9.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 +7 -7
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -143,7 +143,7 @@ const rules$6 = {
|
|
|
143
143
|
//#endregion
|
|
144
144
|
//#region package.json
|
|
145
145
|
var name$6 = "eslint-plugin-react-x";
|
|
146
|
-
var version = "5.9.
|
|
146
|
+
var version = "5.9.4";
|
|
147
147
|
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/utils/create-rule.ts
|
|
@@ -1913,7 +1913,7 @@ function create$46(context) {
|
|
|
1913
1913
|
case AST_NODE_TYPES.LogicalExpression: return [...checkKeyExpression(node.left), ...checkKeyExpression(node.right)];
|
|
1914
1914
|
case AST_NODE_TYPES.CallExpression: {
|
|
1915
1915
|
const callee = Extract.unwrap(node.callee);
|
|
1916
|
-
if (callee.type === AST_NODE_TYPES.MemberExpression &&
|
|
1916
|
+
if (callee.type === AST_NODE_TYPES.MemberExpression && Extract.getPropertyName(callee.property) === "toString" && isArrayIndex(callee.object)) return [{
|
|
1917
1917
|
messageId: "default",
|
|
1918
1918
|
node: callee.object
|
|
1919
1919
|
}];
|
|
@@ -2369,7 +2369,7 @@ function create$32(context) {
|
|
|
2369
2369
|
const call = Traverse.findParent(jsxElement, (n) => {
|
|
2370
2370
|
if (n.type !== AST_NODE_TYPES.CallExpression) return false;
|
|
2371
2371
|
const callee = Extract.unwrap(n.callee);
|
|
2372
|
-
return callee.type === AST_NODE_TYPES.MemberExpression &&
|
|
2372
|
+
return callee.type === AST_NODE_TYPES.MemberExpression && Extract.getPropertyName(callee.property) === "map";
|
|
2373
2373
|
});
|
|
2374
2374
|
const iter = Traverse.findParent(jsxElement, Check.isFunction, (n) => n === call);
|
|
2375
2375
|
if (!Check.isFunction(iter)) return;
|
|
@@ -3271,7 +3271,7 @@ function containsUseComments(context, node) {
|
|
|
3271
3271
|
return context.sourceCode.getCommentsInside(node).some(({ value }) => /use\([\s\S]*?\)/u.test(value) || /use[A-Z0-9]\w*\([\s\S]*?\)/u.test(value));
|
|
3272
3272
|
}
|
|
3273
3273
|
function isTestMock(node) {
|
|
3274
|
-
return node != null && node.type === AST_NODE_TYPES.MemberExpression && node.object.type === AST_NODE_TYPES.Identifier &&
|
|
3274
|
+
return node != null && node.type === AST_NODE_TYPES.MemberExpression && node.object.type === AST_NODE_TYPES.Identifier && Extract.getPropertyName(node.property) === "mock";
|
|
3275
3275
|
}
|
|
3276
3276
|
function isTestMockCallback(node) {
|
|
3277
3277
|
return node != null && Check.isFunction(node) && node.parent.type === AST_NODE_TYPES.CallExpression && isTestMock(node.parent.callee) && node.parent.arguments[1] === node;
|
|
@@ -6854,7 +6854,7 @@ function create$5(context) {
|
|
|
6854
6854
|
};
|
|
6855
6855
|
function isThenCall(node) {
|
|
6856
6856
|
const callee = Extract.unwrap(node.callee);
|
|
6857
|
-
return callee.type === AST_NODE_TYPES.MemberExpression &&
|
|
6857
|
+
return callee.type === AST_NODE_TYPES.MemberExpression && Extract.getPropertyName(callee.property) === "then";
|
|
6858
6858
|
}
|
|
6859
6859
|
function isUseStateCall(node) {
|
|
6860
6860
|
return core.isUseStateLikeCall(node, additionalStateHooks);
|
|
@@ -6898,7 +6898,7 @@ function create$5(context) {
|
|
|
6898
6898
|
const innerCallee = Extract.unwrap(callee.callee);
|
|
6899
6899
|
if (innerCallee.type !== AST_NODE_TYPES.MemberExpression) return false;
|
|
6900
6900
|
if (!("name" in innerCallee.object)) return false;
|
|
6901
|
-
const isAt =
|
|
6901
|
+
const isAt = Extract.getPropertyName(innerCallee.property) === "at";
|
|
6902
6902
|
const [index] = callee.arguments;
|
|
6903
6903
|
if (!isAt || index == null) return false;
|
|
6904
6904
|
return getStaticValue(index, context.sourceCode.getScope(node))?.value === 1 && isIdFromUseStateCall(innerCallee.object);
|
|
@@ -7120,7 +7120,7 @@ function create$4(context) {
|
|
|
7120
7120
|
const innerCallee = Extract.unwrap(callee.callee);
|
|
7121
7121
|
if (innerCallee.type !== AST_NODE_TYPES.MemberExpression) return false;
|
|
7122
7122
|
if (!("name" in innerCallee.object)) return false;
|
|
7123
|
-
const isAt =
|
|
7123
|
+
const isAt = Extract.getPropertyName(innerCallee.property) === "at";
|
|
7124
7124
|
const [index] = callee.arguments;
|
|
7125
7125
|
if (!isAt || index == null) return false;
|
|
7126
7126
|
return getStaticValue(index, context.sourceCode.getScope(node))?.value === 1 && isIdFromUseStateCall(innerCallee.object);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.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
|
"react",
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
"dist"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
40
|
-
"@typescript-eslint/type-utils": "^8.
|
|
41
|
-
"@typescript-eslint/types": "^8.
|
|
42
|
-
"@typescript-eslint/typescript-estree": "^8.
|
|
43
|
-
"@typescript-eslint/utils": "^8.
|
|
39
|
+
"@typescript-eslint/scope-manager": "^8.62.0",
|
|
40
|
+
"@typescript-eslint/type-utils": "^8.62.0",
|
|
41
|
+
"@typescript-eslint/types": "^8.62.0",
|
|
42
|
+
"@typescript-eslint/typescript-estree": "^8.62.0",
|
|
43
|
+
"@typescript-eslint/utils": "^8.62.0",
|
|
44
44
|
"compare-versions": "^6.1.1",
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-api-utils": "^2.5.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "5.9.
|
|
49
|
-
"@eslint-react/core": "5.9.
|
|
50
|
-
"@eslint-react/eslint": "5.9.
|
|
51
|
-
"@eslint-react/jsx": "5.9.
|
|
52
|
-
"@eslint-react/shared": "5.9.
|
|
53
|
-
"@eslint-react/var": "5.9.
|
|
48
|
+
"@eslint-react/ast": "5.9.4",
|
|
49
|
+
"@eslint-react/core": "5.9.4",
|
|
50
|
+
"@eslint-react/eslint": "5.9.4",
|
|
51
|
+
"@eslint-react/jsx": "5.9.4",
|
|
52
|
+
"@eslint-react/shared": "5.9.4",
|
|
53
|
+
"@eslint-react/var": "5.9.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.17",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"react-dom": "^19.2.7",
|
|
62
62
|
"tsdown": "^0.22.3",
|
|
63
63
|
"tsl": "^1.0.30",
|
|
64
|
-
"tsl-dx": "^0.
|
|
64
|
+
"tsl-dx": "^0.13.1",
|
|
65
65
|
"typescript": "6.0.3",
|
|
66
66
|
"@local/configs": "0.0.0",
|
|
67
67
|
"@local/eff": "0.0.0"
|