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): catch unverified claims with an adjective after the number (#38)

Nguyễn Tuấn Anh4a86fe8e4dde
diff --git a/skills/unslop-anything/scripts/detect.js b/skills/unslop-anything/scripts/detect.js
index bef42b5..f590e56 100644
--- a/skills/unslop-anything/scripts/detect.js
+++ b/skills/unslop-anything/scripts/detect.js
@@ -668,7 +668,7 @@ const rules = [
message: "Social proof or speed claim that the page does not back up.",
fix: "Use a real, sourced number with what it compares to, or remove it. Never ship invented customer counts, logo walls, or testimonials.",
find({ code }) {
- const re = /\b(?:trusted|loved|used) by (?:over |more than )?[\d,.]+\s*[kKM]?\+?\s*(?:teams|companies|developers|users|customers|people|businesses)|\bjoin (?:over |more than )?[\d,.]+\s*[kKM]?\+?\s+(?:teams|companies|developers|users|customers|people|others|creators)|\b\d+x (?:faster|better|more productive|cheaper)\b/i;
+ const re = /\b(?:trusted|loved|used) by (?:over |more than )?[\d,.]+\s*[kKM]?\+?\s*(?:[A-Za-z]+\s+)?(?:teams|companies|developers|users|customers|people|businesses)|\bjoin (?:over |more than )?[\d,.]+\s*[kKM]?\+?\s+(?:[A-Za-z]+\s+)?(?:teams|companies|developers|users|customers|people|others|creators)|\b\d+x (?:faster|better|more productive|cheaper)\b/i;
return [...matches(re, code)].map((m) => m.index);
},
},
diff --git a/test/detect.test.js b/test/detect.test.js
index 445c3cd..a84f93d 100644
--- a/test/detect.test.js
+++ b/test/detect.test.js
@@ -280,6 +280,15 @@ test("an arrow function in an attribute does not end the tag for clickable-div a
assert.deepStrictEqual(rulesFor("<img src={src} onError={() => setBroken(true)} />\n"), ["img-no-alt"]);
});
+test("unverified-claim allows one adjective between the number and the noun", () => {
+ const rulesFor = (src) => scanSource(src, "a.tsx").map((f) => f.rule);
+ assert.deepStrictEqual(rulesFor("<p>Join 10,000+ customers</p>\n"), ["unverified-claim"]);
+ assert.deepStrictEqual(rulesFor("<p>Join 10,000+ happy customers</p>\n"), ["unverified-claim"]);
+ assert.deepStrictEqual(rulesFor("<p>Trusted by 5,000 growing teams</p>\n"), ["unverified-claim"]);
+ // A time phrase is not a social-proof claim.
+ assert.deepStrictEqual(rulesFor("<p>Join 10 minutes early</p>\n"), []);
+});
+
test("the installer rejects an unknown flag before it copies anything", () => {
const fs = require("fs");
const os = require("os");