oxlint-plugin-react-doctor 0.7.4-dev.5aa82e8 → 0.7.4-dev.6821fe0

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 +1 -43
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15787,40 +15787,6 @@ const isArrayVariableRenderedAsList = (declarator) => {
15787
15787
  renderedAsListCache.set(declarator, didFindRenderingUse);
15788
15788
  return didFindRenderingUse;
15789
15789
  };
15790
- const namedCallbackIteratorCallCache = /* @__PURE__ */ new WeakMap();
15791
- const findNamedCallbackIteratorCall = (functionNode) => {
15792
- const cached = namedCallbackIteratorCallCache.get(functionNode);
15793
- if (cached !== void 0) return cached;
15794
- const bindingIdentifier = getFunctionBindingIdentifier(functionNode);
15795
- if (!bindingIdentifier) {
15796
- namedCallbackIteratorCallCache.set(functionNode, null);
15797
- return null;
15798
- }
15799
- const programRoot = findProgramRoot(functionNode);
15800
- if (!programRoot) {
15801
- namedCallbackIteratorCallCache.set(functionNode, null);
15802
- return null;
15803
- }
15804
- let iteratorCall = null;
15805
- walkAst(programRoot, (node) => {
15806
- if (iteratorCall) return false;
15807
- if (!isNodeOfType(node, "Identifier") || node === bindingIdentifier || node.name !== bindingIdentifier.name) return;
15808
- const binding = findVariableInitializer(node, node.name);
15809
- if (!binding || binding.bindingIdentifier !== bindingIdentifier) return;
15810
- const callbackExpression = findTransparentExpressionRoot(node);
15811
- const callExpression = callbackExpression.parent;
15812
- if (!callExpression || !isNodeOfType(callExpression, "CallExpression")) return;
15813
- const callee = callExpression.callee;
15814
- if (!isNodeOfType(callee, "MemberExpression") || !isNodeOfType(callee.property, "Identifier") || !ITERATOR_METHOD_NAMES$1.has(callee.property.name)) return;
15815
- const callbackIndex = callee.property.name === "from" ? 1 : 0;
15816
- if (callExpression.arguments[callbackIndex] !== callbackExpression) return;
15817
- if (isNonChildrenJsxAttributeValue(callExpression)) return;
15818
- iteratorCall = callExpression;
15819
- return false;
15820
- });
15821
- namedCallbackIteratorCallCache.set(functionNode, iteratorCall);
15822
- return iteratorCall;
15823
- };
15824
15790
  const findEnclosingIteratorContext = (jsxNode) => {
15825
15791
  let current = jsxNode;
15826
15792
  let isOutsideContainingFunction = false;
@@ -15835,11 +15801,6 @@ const findEnclosingIteratorContext = (jsxNode) => {
15835
15801
  const grandparent = parent.parent;
15836
15802
  if (grandparent && isNodeOfType(grandparent, "Property")) return null;
15837
15803
  if (isOutsideContainingFunction) return null;
15838
- const namedCallbackIteratorCall = findNamedCallbackIteratorCall(parent);
15839
- if (namedCallbackIteratorCall) return {
15840
- kind: "iterator",
15841
- callExpression: namedCallbackIteratorCall
15842
- };
15843
15804
  isOutsideContainingFunction = true;
15844
15805
  } else if (isNodeOfType(parent, "ArrayExpression")) {
15845
15806
  if (isOutsideContainingFunction) return null;
@@ -15883,10 +15844,7 @@ const resolveIterationItemName = (callExpression) => {
15883
15844
  if (!isNodeOfType(callee, "MemberExpression")) return null;
15884
15845
  if (!isNodeOfType(callee.property, "Identifier")) return null;
15885
15846
  const targetArgIndex = callee.property.name === "from" ? 1 : 0;
15886
- const callbackArgument = callExpression.arguments[targetArgIndex];
15887
- if (!callbackArgument) return null;
15888
- const unwrappedCallback = stripParenExpression(callbackArgument);
15889
- const callback = isNodeOfType(unwrappedCallback, "Identifier") ? findVariableInitializer(unwrappedCallback, unwrappedCallback.name)?.initializer : unwrappedCallback;
15847
+ const callback = callExpression.arguments[targetArgIndex];
15890
15848
  if (!callback || !isNodeOfType(callback, "ArrowFunctionExpression") && !isNodeOfType(callback, "FunctionExpression")) return null;
15891
15849
  const firstParam = callback.params[0];
15892
15850
  return firstParam && isNodeOfType(firstParam, "Identifier") ? firstParam.name : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-react-doctor",
3
- "version": "0.7.4-dev.5aa82e8",
3
+ "version": "0.7.4-dev.6821fe0",
4
4
  "description": "React Doctor rules for oxlint.",
5
5
  "keywords": [
6
6
  "accessibility",