eslint-plugin-react-x 5.9.3 → 5.9.5

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 (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +7 -7
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.3";
146
+ var version = "5.9.5";
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 && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "toString" && isArrayIndex(callee.object)) return [{
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 && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "map";
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 && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === "mock";
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 && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "then";
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 = innerCallee.property.type === AST_NODE_TYPES.Identifier && innerCallee.property.name === "at";
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 = innerCallee.property.type === AST_NODE_TYPES.Identifier && innerCallee.property.name === "at";
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",
3
+ "version": "5.9.5",
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",
@@ -45,12 +45,12 @@
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.3",
49
- "@eslint-react/core": "5.9.3",
50
- "@eslint-react/eslint": "5.9.3",
51
- "@eslint-react/shared": "5.9.3",
52
- "@eslint-react/jsx": "5.9.3",
53
- "@eslint-react/var": "5.9.3"
48
+ "@eslint-react/ast": "5.9.5",
49
+ "@eslint-react/core": "5.9.5",
50
+ "@eslint-react/eslint": "5.9.5",
51
+ "@eslint-react/shared": "5.9.5",
52
+ "@eslint-react/var": "5.9.5",
53
+ "@eslint-react/jsx": "5.9.5"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.2.17",