oxlint-plugin-react-doctor 0.6.2-dev.397816a → 0.6.2-dev.b4faf74

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 +10 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3458,7 +3458,7 @@ const SECRET_UNAMBIGUOUS_PLACEHOLDER_VALUE_PATTERNS = [
3458
3458
  ];
3459
3459
  const SECRET_CONTEXTUAL_PLACEHOLDER_VALUE_PATTERNS = [/(?:^|[_\-\s])(?:example|sample|dummy)(?:$|[_\-\s])/i];
3460
3460
  const SECRET_PLACEHOLDER_CONTEXT_PATTERN = /(?:placeholder|example|sample|dummy|masked|redacted|mask)/i;
3461
- const SECRET_VARIABLE_PATTERN = /(?:api_?key|secret|token|password|credential|auth)/i;
3461
+ const SECRET_VARIABLE_PATTERN = /(?:api_?key|secret|token|password|credential|auth(?!or(?!i[sz])))/i;
3462
3462
  const SECRET_TOOLING_FILE_PATTERN = /(?:^|\/)[^/]+\.config\.[cm]?[jt]s$/;
3463
3463
  const SECRET_TOOLING_RC_FILE_PATTERN = /(?:^|\/)(?:\.[a-z-]+rc|[a-z-]+\.rc)\.[cm]?[jt]s$/;
3464
3464
  const SECRET_TEST_FILE_PATTERN = /(?:^|\/)[^/]+\.(?:test|spec|stories|story|fixture|fixtures)\.[cm]?[jt]sx?$/;
@@ -12529,6 +12529,7 @@ const KNOWN_SLOT_PROP_NAMES = new Set([
12529
12529
  "bottomContent",
12530
12530
  "leftContent",
12531
12531
  "rightContent",
12532
+ "config",
12532
12533
  "value",
12533
12534
  "currentValue",
12534
12535
  "form",
@@ -12667,6 +12668,10 @@ const SLOT_PROP_SUFFIXES = [
12667
12668
  "Panel",
12668
12669
  "Overlay",
12669
12670
  "Shape",
12671
+ "Avatar",
12672
+ "Text",
12673
+ "State",
12674
+ "Zone",
12670
12675
  "Override",
12671
12676
  "Overrides",
12672
12677
  "Items",
@@ -12683,6 +12688,8 @@ const SLOT_PROP_SUFFIXES = [
12683
12688
  ];
12684
12689
  const isSlotPropName = (propName) => {
12685
12690
  if (KNOWN_SLOT_PROP_NAMES.has(propName)) return true;
12691
+ const decapitalized = propName.charAt(0).toLowerCase() + propName.slice(1);
12692
+ if (decapitalized !== propName && KNOWN_SLOT_PROP_NAMES.has(decapitalized)) return true;
12686
12693
  for (const suffix of SLOT_PROP_SUFFIXES) if (propName.length > suffix.length && propName.endsWith(suffix)) return true;
12687
12694
  return false;
12688
12695
  };
@@ -29728,10 +29735,10 @@ const onlyExportComponents = defineRule({
29728
29735
  };
29729
29736
  for (const child of componentCandidates) {
29730
29737
  if (isNodeOfType(child, "FunctionDeclaration") && child.id) {
29731
- if (isReactComponentName(child.id.name) && !isInsideExport(child)) localComponents.push(child.id);
29738
+ if (isReactComponentName(child.id.name) && !isInsideExport(child) && !isInsideFunctionScope(child)) localComponents.push(child.id);
29732
29739
  }
29733
29740
  if (isNodeOfType(child, "VariableDeclarator") && isNodeOfType(child.id, "Identifier")) {
29734
- if (isReactComponentName(child.id.name) && canBeReactFunctionComponent(child.init, state) && !isInsideExport(child)) localComponents.push(child.id);
29741
+ if (isReactComponentName(child.id.name) && canBeReactFunctionComponent(child.init, state) && !isInsideExport(child) && !isInsideFunctionScope(child)) localComponents.push(child.id);
29735
29742
  }
29736
29743
  }
29737
29744
  if (hasAnyExports && hasReactExport) for (const entry of exports) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-react-doctor",
3
- "version": "0.6.2-dev.397816a",
3
+ "version": "0.6.2-dev.b4faf74",
4
4
  "description": "React Doctor rules for oxlint.",
5
5
  "keywords": [
6
6
  "accessibility",