oxlint-plugin-react-doctor 0.5.6-dev.6b8e756 → 0.5.6-dev.81bbfcc

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 +11 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -36072,7 +36072,13 @@ const serverNoMutableModuleState = defineRule({
36072
36072
  const collectDeclaredNames = (declaration) => {
36073
36073
  const names = /* @__PURE__ */ new Set();
36074
36074
  if (!isNodeOfType(declaration, "VariableDeclaration")) return names;
36075
- for (const declarator of declaration.declarations ?? []) collectPatternNames(declarator.id, names);
36075
+ for (const declarator of declaration.declarations ?? []) if (isNodeOfType(declarator.id, "Identifier")) names.add(declarator.id.name);
36076
+ else if (isNodeOfType(declarator.id, "ObjectPattern")) {
36077
+ for (const property of declarator.id.properties ?? []) if (isNodeOfType(property, "Property") && isNodeOfType(property.value, "Identifier")) names.add(property.value.name);
36078
+ else if (isNodeOfType(property, "RestElement") && isNodeOfType(property.argument, "Identifier")) names.add(property.argument.name);
36079
+ } else if (isNodeOfType(declarator.id, "ArrayPattern")) {
36080
+ for (const element of declarator.id.elements ?? []) if (isNodeOfType(element, "Identifier")) names.add(element.name);
36081
+ }
36076
36082
  return names;
36077
36083
  };
36078
36084
  const declarationStartsWithAwait = (declaration) => {
@@ -36082,15 +36088,11 @@ const declarationStartsWithAwait = (declaration) => {
36082
36088
  };
36083
36089
  const declarationReadsAnyName = (declaration, names) => {
36084
36090
  if (names.size === 0) return false;
36085
- if (!isNodeOfType(declaration, "VariableDeclaration")) return false;
36086
36091
  let didRead = false;
36087
- for (const declarator of declaration.declarations ?? []) {
36088
- if (!declarator.init) continue;
36089
- walkAst(declarator.init, (child) => {
36090
- if (didRead) return;
36091
- if (isNodeOfType(child, "Identifier") && names.has(child.name)) didRead = true;
36092
- });
36093
- }
36092
+ walkAst(declaration, (child) => {
36093
+ if (didRead) return;
36094
+ if (isNodeOfType(child, "Identifier") && names.has(child.name)) didRead = true;
36095
+ });
36094
36096
  return didRead;
36095
36097
  };
36096
36098
  const serverSequentialIndependentAwait = defineRule({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-react-doctor",
3
- "version": "0.5.6-dev.6b8e756",
3
+ "version": "0.5.6-dev.81bbfcc",
4
4
  "description": "oxlint plugin for React Doctor: diagnose React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
5
5
  "keywords": [
6
6
  "accessibility",