oxlint-plugin-react-doctor 0.9.0-dev.707378a → 0.9.0-dev.8765ca3
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.
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43681,8 +43681,8 @@ const BODY_TEXT_ELEMENT_NAMES$1 = new Set([
|
|
|
43681
43681
|
"p",
|
|
43682
43682
|
"td"
|
|
43683
43683
|
]);
|
|
43684
|
-
const
|
|
43685
|
-
const
|
|
43684
|
+
const CASED_LETTER_PATTERN = /[\p{Lu}\p{Ll}\p{Lt}]/u;
|
|
43685
|
+
const UPPERCASE_LETTER_PATTERN = /\p{Lu}/u;
|
|
43686
43686
|
const hasUppercaseStyle = (node) => {
|
|
43687
43687
|
const classNameValue = getStringFromClassNameAttr(node);
|
|
43688
43688
|
if (classNameValue && getUnvariantClassNameTokens(classNameValue).includes("uppercase")) return true;
|
|
@@ -43707,8 +43707,8 @@ const noAllCapsBodyText = defineRule({
|
|
|
43707
43707
|
if (!isNodeOfType(openingElement.name, "JSXIdentifier")) return;
|
|
43708
43708
|
if (!BODY_TEXT_ELEMENT_NAMES$1.has(openingElement.name.name)) return;
|
|
43709
43709
|
const staticText = getStaticJsxText(node).replace(/\s+/g, " ").trim();
|
|
43710
|
-
if (staticText.length < 48 || !
|
|
43711
|
-
if (
|
|
43710
|
+
if (staticText.length < 48 || !CASED_LETTER_PATTERN.test(staticText)) return;
|
|
43711
|
+
if (!(UPPERCASE_LETTER_PATTERN.test(staticText) && staticText === staticText.toUpperCase()) && !hasUppercaseStyle(openingElement)) return;
|
|
43712
43712
|
context.report({
|
|
43713
43713
|
node: openingElement,
|
|
43714
43714
|
message: "Long all-caps copy is difficult to scan. Use sentence case here and keep uppercase treatment for compact labels."
|