Skip to content

Your app looks AI-generated. Vincent Van Gogh noticed. An agent skill that finds and fixes AI-looking UI and UX in mobile apps, web apps, and websites.

fix(detect): flag Remix Icon RiSparkling names and ri-sparkling classes in sparkle-icon (#257)

tarekoooooood94a8adf66da
diff --git a/skills/unslop-anything/scripts/detect.js b/skills/unslop-anything/scripts/detect.js
index 2f0bbc9..39195dc 100644
--- a/skills/unslop-anything/scripts/detect.js
+++ b/skills/unslop-anything/scripts/detect.js
@@ -1044,7 +1044,7 @@ const rules = [
// when the literal is exactly that symbol; substrings and apostrophes
// inside longer text stay quiet.
const symbol = /^(?:sparkles?(?:\.[a-z0-9._-]+)?|wand\.and\.(?:stars|sparkles)(?:\.[a-z0-9._-]+)?|[a-z0-9-]+:sparkles?|i-[a-z0-9-]+-sparkles?|wand-magic-sparkles)$/;
- const re = /\bauto_awesome\b|\bAutoAwesome(?:Outlined|Rounded|Sharp|TwoTone)?(?:Icon)?\b|\bSparkles\b|\bSparklesIcon\b|\bSparkle\b|\bSparkleIcon\b|\bIconSparkles\b|\bWandSparkles\b|\bWandSparklesIcon\b|✨|\b(?:Hi(?:Outline|Mini)?|Lu|Tb|Pi|Bs|Io|Ri)Sparkles?(?:Fill|Line|Outline|Sharp|Bold|Duotone|Light|Thin)?\b|\bMd(?:Outline|Round|Sharp|TwoTone)?AutoAwesome\b|\bfaWandMagicSparkles\b|(?<![\w-])fa-wand-magic-sparkles(?![\w-])/;
+ const re = /\bauto_awesome\b|\bAutoAwesome(?:Outlined|Rounded|Sharp|TwoTone)?(?:Icon)?\b|\bSparkles\b|\bSparklesIcon\b|\bSparkle\b|\bSparkleIcon\b|\bIconSparkles\b|\bWandSparkles\b|\bWandSparklesIcon\b|✨|\b(?:Hi(?:Outline|Mini)?|Lu|Tb|Pi|Bs|Io|Ri)Sparkles?(?:Fill|Line|Outline|Sharp|Bold|Duotone|Light|Thin)?\b|\bRiSparkling(?:2)?(?:Fill|Line)?\b|\bMd(?:Outline|Round|Sharp|TwoTone)?AutoAwesome\b|\bfaWandMagicSparkles\b|(?<![\w-])fa-wand-magic-sparkles(?![\w-])|(?<![\w-])ri-sparkling(?:-2)?-(?:line|fill)(?![\w-])/;
const hits = [...matches(re, code)].map((m) => m.index);
for (const literal of stringLiterals(code, stack)) {
diff --git a/test/detect.test.js b/test/detect.test.js
index fb572a9..f620d81 100644
--- a/test/detect.test.js
+++ b/test/detect.test.js
@@ -1844,12 +1844,15 @@ test("sparkle-icon flags Iconify and Nuxt sparkle icon names, not prose or unrel
' <Icon icon="heroicons:sparkles" />',
' <Icon icon="ph:sparkle" />',
' <Icon icon="tabler:sparkles" />',
+ ' <i class="ri-sparkling-line"></i>',
+ ' <i class="ri-sparkling-2-fill"></i>',
' <p>Add some sparkles</p>',
+ ' <span>sparkling water</span>',
' <Icon icon="lucide:star" />',
"</template>",
].join("\n");
const findings = scanSource(vue, "Badge.vue").filter((f) => f.rule === "sparkle-icon");
- assert.deepStrictEqual(findings.map((f) => f.line), [2, 3, 4, 5, 6, 7]);
+ assert.deepStrictEqual(findings.map((f) => f.line), [2, 3, 4, 5, 6, 7, 8, 9]);
});
test("sparkle-icon flags react-icons sparkle names, not unrelated icons", () => {
@@ -1857,7 +1860,7 @@ test("sparkle-icon flags react-icons sparkle names, not unrelated icons", () =>
// Issue #197: the repro.
const repro = 'import { HiSparkles } from "react-icons/hi2";\nimport { MdAutoAwesome } from "react-icons/md";\n\nexport function AiBadge() {\n return <HiSparkles />;\n}\n';
assert.deepStrictEqual(sparkleLines(repro), [1, 2, 5]);
- for (const name of ["HiSparkles", "HiOutlineSparkles", "LuSparkles", "TbSparkles", "PiSparkle", "IoSparklesSharp", "IoSparklesOutline", "MdAutoAwesome", "MdOutlineAutoAwesome"]) {
+ for (const name of ["HiSparkles", "HiOutlineSparkles", "LuSparkles", "TbSparkles", "PiSparkle", "IoSparklesSharp", "IoSparklesOutline", "MdAutoAwesome", "MdOutlineAutoAwesome", "RiSparklingLine", "RiSparklingFill", "RiSparkling2Line", "RiSparkling2Fill"]) {
assert.deepStrictEqual(sparkleLines(`<${name} />\n`), [1], name);
}
for (const name of ["HiStar", "MdAutoGraph", "SparkleCounter"]) {