The design language that makes your AI harness better at design.
JavaScript
Ignore rounded-none in border accents
Paul Bakaus872c032582ea
diff --git a/cli/engine/engines/regex/detect-text.mjs b/cli/engine/engines/regex/detect-text.mjsindex c664f70b6..03cb0d978 100644--- a/cli/engine/engines/regex/detect-text.mjs+++ b/cli/engine/engines/regex/detect-text.mjs@@ -12,7 +12,8 @@ import { profileFindings, profileStep } from '../../profile/profiler.mjs';// Regex fallback (non-HTML files: CSS, JSX, TSX, etc.)// ----------------------------------------------------------------------------const hasRounded = (line) => /\brounded(?:-\w+)?\b/.test(line);+const hasRounded = (line) =>+ /\brounded(?:-\w+)?\b/.test(line.replace(/\brounded-none\b/g, ''));const hasBorderRadius = (line) => /border-radius/i.test(line);const isSafeElement = (line) => /<(?:blockquote|nav[\s>]|pre[\s>]|code[\s>]|a\s|input[\s>]|span[\s>])/i.test(line);diff --git a/tests/detect-antipatterns.test.js b/tests/detect-antipatterns.test.jsindex 8fd08f464..85ae0c2e9 100644--- a/tests/detect-antipatterns.test.js+++ b/tests/detect-antipatterns.test.js@@ -199,6 +199,22 @@ describe('detectText — Tailwind side-tab', () => {const f = detectText('<div class="border-t-4 border-b-4">', 'test.html');expect(f.filter(r => r.antipattern === 'border-accent-on-rounded')).toHaveLength(0);});++ test('ignores border accent paired with rounded-none', () => {+ const f = detectText(+ '<TabsTrigger className="rounded-none border-b-2 border-transparent data-[state=active]:border-primary" />',+ 'test.tsx',+ );+ expect(f.filter(r => r.antipattern === 'border-accent-on-rounded')).toHaveLength(0);+ });++ test('still detects a real rounded token alongside rounded-none', () => {+ const f = detectText(+ '<div className="rounded-none md:rounded-lg border-b-2 border-primary" />',+ 'test.tsx',+ );+ expect(f.some(r => r.antipattern === 'border-accent-on-rounded')).toBe(true);+ });});describe('detectText — CSS borders', () => {