ss-lint
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDesign Lint (Quick Check)
设计系统代码检查(快速校验)
Read and ; invoke or
first when they are missing or stale. Lint detects deterministic drift; it must
not flag an exact grammar/recipe/profile/adapter contract as a violation or let an arbitrary lock
value create an exception.
.styleseed/effective-rules.md.styleseed/manifest.json/ss-resolve$ss-resolve读取和文件;若文件缺失或已过期,请先调用或。代码检查用于检测确定性偏差;不得将符合语法/规则/配置/适配器约定的内容标记为违规,也不得因任意锁定值而产生例外。
.styleseed/effective-rules.md.styleseed/manifest.json/ss-resolve$ss-resolveWhen NOT to use
不适用场景
- For deeper review of design judgment (composition, hierarchy, rhythm) → use
/ss-review - For accessibility specifically → use
/ss-a11y - For Nielsen UX heuristics → use
/ss-audit - For applying refactors — this only flags violations; use to fix
/ss-review
Target: $ARGUMENTS
- 若需深度评审设计判断(布局、层级、节奏)→ 使用
/ss-review - 若专门检查无障碍性 → 使用
/ss-a11y - 若需检查尼尔森UX启发式原则 → 使用
/ss-audit - 若需重构代码——本工具仅标记违规;请使用进行修复
/ss-review
目标:$ARGUMENTS
What This Does
功能说明
Fast, grep-based scan for common design violations. Runs in seconds (unlike /ss-review which is a deep manual audit). Run this after every file change.
基于grep的快速扫描,用于检测常见设计违规问题。几秒内即可完成(不同于的深度人工审核)。建议每次文件修改后运行本工具。
/ss-reviewChecks
检查项
1. Hardcoded Colors
1. 硬编码颜色
Search for hex colors in className strings that should be semantic tokens:
bash
grep -n '#[0-9a-fA-F]\{3,8\}' [file] | grep -v 'theme.css\|tokens\|\.json'Violation: ,
Fix: ,
text-[#3C3C3C]bg-[#3182F6]text-text-primarybg-brand搜索className字符串中应使用语义化令牌的十六进制颜色:
bash
grep -n '#[0-9a-fA-F]\{3,8\}' [file] | grep -v 'theme.css\|tokens\|\.json'违规示例: ,
修复方案: ,
text-[#3C3C3C]bg-[#3182F6]text-text-primarybg-brand2. Raw Pixel Values in Tailwind
2. Tailwind中的原始像素值
bash
grep -n 'p-\[.*px\]\|m-\[.*px\]\|gap-\[.*px\]' [file]Violation: ,
Fix: ,
p-[24px]gap-[12px]p-6gap-3bash
grep -n 'p-\[.*px\]\|m-\[.*px\]\|gap-\[.*px\]' [file]违规示例: ,
修复方案: ,
p-[24px]gap-[12px]p-6gap-33. Old Width/Height Syntax
3. 旧版宽/高语法
bash
grep -n 'w-[0-9] h-[0-9]\|w-\[.*\] h-\[' [file]Violation:
Fix:
w-4 h-4size-4bash
grep -n 'w-[0-9] h-[0-9]\|w-\[.*\] h-\[' [file]违规示例:
修复方案:
w-4 h-4size-44. Physical Properties (LTR-only)
4. 物理属性(仅支持从左到右布局)
bash
grep -n ' ml-\| mr-\| pl-\| pr-' [file]Violation: ,
Fix: ,
ml-2mr-4ms-2me-4bash
grep -n ' ml-\| mr-\| pl-\| pr-' [file]违规示例: ,
修复方案: ,
ml-2mr-4ms-2me-45. Uncontracted Hard Black
5. 未约定的纯黑色
bash
grep -n 'text-black\|bg-black\|#000000\|#000"' [file]Violation: Pure black without an exact structural role in the selected grammar/profile
Fix: Use the semantic ink token, or cite the maintained contract that requires hard black
bash
grep -n 'text-black\|bg-black\|#000000\|#000"' [file]违规示例: 在所选语法/配置中没有明确结构用途的纯黑色
修复方案: 使用语义化文本令牌,或引用要求使用纯黑色的维护约定
6. Missing data-slot
6. 缺失data-slot属性
bash
grep -n 'function [A-Z]' [file] # find components
grep -n 'data-slot' [file] # check if presentViolation: Component without
Fix: Add
data-slotdata-slot="component-name"bash
grep -n 'function [A-Z]' [file] # 查找组件
grep -n 'data-slot' [file] # 检查是否存在违规示例: 组件未添加
修复方案: 添加
data-slotdata-slot="component-name"7. Font Size CSS Variables (CRITICAL — Tailwind v4 conflict)
7. 字体大小CSS变量(严重问题——与Tailwind v4冲突)
bash
grep -n 'text-\[var(--' [file]
grep -n '\-\-text-.*px\|--fs-.*px' [file]Violation: or in theme.css
Fix: Use explicit . CSS variable font sizes conflict with Tailwind v4's namespace — Tailwind reads them as color, not font-size.
text-[var(--text-sm)]--text-sm: 13pxtext-[13px]--text-*bash
grep -n 'text-\[var(--' [file]
grep -n '\-\-text-.*px\|--fs-.*px' [file]违规示例: 或 theme.css中的
修复方案: 使用明确的。CSS变量字体大小与Tailwind v4的命名空间冲突——Tailwind会将其识别为颜色而非字体大小。
text-[var(--text-sm)]--text-sm: 13pxtext-[13px]--text-*8. className Without cn()
8. 未使用cn()的className
bash
grep -n 'className={`' [file]Violation: Template literal className
Fix: Use for all className composition
cn()bash
grep -n 'className={`' [file]违规示例: 使用模板字符串的className
修复方案: 所有className组合均使用
cn()9. Universal Soft-card Drift
9. 通用Soft-card偏差
Search for repeated , , and in pattern files.
Flag the combination when the selected recipe is not .
Fix: use , , and the other recipe-aware helper classes.
rounded-2xlshadow-[var(--shadow-card)]mx-6calm-consumerss-pattern-surfacess-page-gutter在模式文件中搜索重复出现的、和。当所选规则不是时,标记该组合。
修复方案: 使用、以及其他感知规则的辅助类。
rounded-2xlshadow-[var(--shadow-card)]mx-6calm-consumerss-pattern-surfacess-page-gutterOutput Format
输出格式
🔴 FAIL [file:line] Hardcoded hex: text-[#3C3C3C] → use text-text-primary
🔴 FAIL [file:line] Raw px: p-[24px] → use p-6
🟡 WARN [file:line] Physical prop: ml-2 → use ms-2
🟡 WARN [file:line] Missing data-slot on MyComponent
🟢 PASS No violations found
Total: X errors, Y warningsIf errors > 0, list specific fixes for each violation.
🔴 FAIL [file:line] Hardcoded hex: text-[#3C3C3C] → use text-text-primary
🔴 FAIL [file:line] Raw px: p-[24px] → use p-6
🟡 WARN [file:line] Physical prop: ml-2 → use ms-2
🟡 WARN [file:line] Missing data-slot on MyComponent
🟢 PASS No violations found
Total: X errors, Y warnings若错误数>0,列出每个违规问题的具体修复方案。