oxlint-plugin-react-doctor 0.9.0-dev.db9d300 → 0.9.1-dev.54ba416

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 +12 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1017,11 +1017,14 @@ const forEachChildNode = (node, visit) => {
1017
1017
  };
1018
1018
  const walkAst = (node, visitor) => {
1019
1019
  if (!node || typeof node !== "object") return;
1020
- const visitNode = (current) => {
1021
- if (visitor(current) === false) return;
1022
- forEachChildNode(current, visitNode);
1023
- };
1024
- visitNode(node);
1020
+ const pendingNodes = [node];
1021
+ while (pendingNodes.length > 0) {
1022
+ const currentNode = pendingNodes.pop();
1023
+ if (currentNode === void 0 || visitor(currentNode) === false) continue;
1024
+ const childNodes = [];
1025
+ forEachChildNode(currentNode, (childNode) => childNodes.push(childNode));
1026
+ for (let childIndex = childNodes.length - 1; childIndex >= 0; childIndex -= 1) pendingNodes.push(childNodes[childIndex]);
1027
+ }
1025
1028
  };
1026
1029
  //#endregion
1027
1030
  //#region src/plugin/rules/state-and-effects/activity-wraps-effect-heavy-subtree.ts
@@ -43678,8 +43681,8 @@ const BODY_TEXT_ELEMENT_NAMES$1 = new Set([
43678
43681
  "p",
43679
43682
  "td"
43680
43683
  ]);
43681
- const LETTER_PATTERN$1 = /\p{L}/u;
43682
- const LOWERCASE_LETTER_PATTERN$1 = /\p{Ll}/u;
43684
+ const CASED_LETTER_PATTERN = /[\p{Lu}\p{Ll}\p{Lt}]/u;
43685
+ const UPPERCASE_LETTER_PATTERN = /\p{Lu}/u;
43683
43686
  const hasUppercaseStyle = (node) => {
43684
43687
  const classNameValue = getStringFromClassNameAttr(node);
43685
43688
  if (classNameValue && getUnvariantClassNameTokens(classNameValue).includes("uppercase")) return true;
@@ -43704,8 +43707,8 @@ const noAllCapsBodyText = defineRule({
43704
43707
  if (!isNodeOfType(openingElement.name, "JSXIdentifier")) return;
43705
43708
  if (!BODY_TEXT_ELEMENT_NAMES$1.has(openingElement.name.name)) return;
43706
43709
  const staticText = getStaticJsxText(node).replace(/\s+/g, " ").trim();
43707
- if (staticText.length < 48 || !LETTER_PATTERN$1.test(staticText)) return;
43708
- if (!!LOWERCASE_LETTER_PATTERN$1.test(staticText) && !hasUppercaseStyle(openingElement)) return;
43710
+ if (staticText.length < 48 || !CASED_LETTER_PATTERN.test(staticText)) return;
43711
+ if (!(UPPERCASE_LETTER_PATTERN.test(staticText) && staticText === staticText.toUpperCase()) && !hasUppercaseStyle(openingElement)) return;
43709
43712
  context.report({
43710
43713
  node: openingElement,
43711
43714
  message: "Long all-caps copy is difficult to scan. Use sentence case here and keep uppercase treatment for compact labels."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-plugin-react-doctor",
3
- "version": "0.9.0-dev.db9d300",
3
+ "version": "0.9.1-dev.54ba416",
4
4
  "description": "React Doctor rules for oxlint.",
5
5
  "keywords": [
6
6
  "accessibility",