当用户希望检查 .vue 文件中的样式规范问题(如 !important 滥用、ID 选择器、非 kebab-case 类名、深度选择器、缺少 scoped)时,使用本技能。
在项目根目录执行:
bash
bash ./scripts/check-vue-style.sh
输出格式为:
text
文件路径:行号: ⚠️ 问题说明
修复完成后再次运行同一命令,直到没有警告为止。
脚本会对每个 .vue 文件的 <style> 区块执行以下检查:
scoped!important#app)/deep/、 >>>、 ::v-deep).user-card-title).vue 文件。scripts/check-vue-style.sh