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 Tabler IconSparkles in sparkle-icon (#175) (#188)

Papito084146f0bc09f88
diff --git a/skills/unslop-anything/scripts/detect.js b/skills/unslop-anything/scripts/detect.js
index 64f285a..6b01735 100644
--- a/skills/unslop-anything/scripts/detect.js
+++ b/skills/unslop-anything/scripts/detect.js
@@ -1013,7 +1013,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?)$/;
- const re = /\bauto_awesome\b|\bAutoAwesome\b|\bSparkles\b|\bSparklesIcon\b|\bSparkle\b|\bSparkleIcon\b|\bWandSparkles\b|\bWandSparklesIcon\b|✨/;
+ const re = /\bauto_awesome\b|\bAutoAwesome\b|\bSparkles\b|\bSparklesIcon\b|\bSparkle\b|\bSparkleIcon\b|\bIconSparkles\b|\bWandSparkles\b|\bWandSparklesIcon\b|✨/;
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 3350fae..df2f1ba 100644
--- a/test/detect.test.js
+++ b/test/detect.test.js
@@ -1494,6 +1494,10 @@ test("sparkle-icon flags the singular and combined icon names", () => {
assert.deepStrictEqual(rulesFor("<WandSparklesIcon />\n"), ["sparkle-icon"]);
// Still flagged, as before.
assert.deepStrictEqual(rulesFor("<Sparkles />\n"), ["sparkle-icon"]);
+ // Tabler IconSparkles
+ assert.deepStrictEqual(rulesFor("<IconSparkles />\n"), ["sparkle-icon"]);
+ assert.deepStrictEqual(rulesFor('import { IconSparkles } from "@tabler/icons-react";\n'), ["sparkle-icon"]);
+ assert.deepStrictEqual(rulesFor("<IconStar />\n"), []);
// A word that only contains the letters is a different component, not a
// sparkle icon: word boundaries keep SparkleCounter unflagged.
assert.deepStrictEqual(rulesFor("<SparkleCounter />\n"), []);