@geoql/vue-doctor
你的经纪人写坏Vue。 这个接住它.
Vue 3应用程序的CLI审计员. 它运行混合扫描:模板-AST通过 @vue/compiler-sfc 加一个脚本通过 oxlint (原产地) vue 插件和医生JS规则),然后将结果合并为定分0-100分. 用于捕捉反间谍,AI-slop,以及最佳做法的违反者,尤其是编码人员留下的人.
安装
# one-off, no install
npx -y @geoql/vue-doctor
# or add it
npm i @geoql/vue-doctor
使用量
vue-doctor [path] [options]
path 默认为当前目录。 默认输出格式为 agent (compact,为LLM消耗而建),不是动词人类报告.
# Audit ./src and print the agent report
vue-doctor ./src
# Human-readable output, fail the build on warnings
vue-doctor --format pretty --fail-on warn
# Machine-readable, only files changed vs HEAD, write to a file
vue-doctor --json --diff --output report.json
# Just the score, for piping into a gate
vue-doctor --score
选项
| 旗帜 | 说明 |
|---|---|
--format <kind> | 输出格式 : agent (违约), pretty, (中文(简体) ), json, (中文(简体) ), json-compact, (中文(简体) ), sarif, (中文(简体) ), html。 。 。 . |
--json | 简指 --format json。 。 。 . |
--json-compact | 单行JSON. |
--config <path> | 路径 doctor.config.ts。 。 。 . |
--preset <name> | 基础预设 : minimal, (中文(简体) ), recommended, (中文(简体) ), strict, (中文(简体) ), all。 。 。 . |
--fail-on <level> | 在此严重或更严重时退出非零: error (违约), warn, (中文(简体) ), none。 。 。 . |
--quiet | 只显示总结. |
--verbose | 将时间和诊断结果 逐一释放出来. |
--no-color | 禁用彩色输出 . |
--rule <id:level> | 超越一条规则,可重复. 级别 : error, (中文(简体) ), warn, (中文(简体) ), info, (中文(简体) ), off例如. --rule vue-doctor/no-em-dash-in-string:off。 。 。 . |
--include <glob> | 要包含的文件的覆盖, 可重复 . |
--exclude <glob> | 模糊文件以排除,可重复. |
--no-dead-code | 跳过死码(knip)分析通关. |
--no-lint | 跳过通关( template / SFC / oxlint). |
--no-respect-inline-disables | 甚至在内部的表面发现 doctor-disable 评论. |
--threshold <n> | 最小通过分数,整数 0– 说吧 –100。 。 。 . |
--score | 只打印出数字分数,用于管道. |
--push | 审核后,POST私隐向SaaS披露了调查结果. 要求数 --api-key可忽略 --no-push。 。 。 . |
--no-push | 跳过 SaaS 推( 默认) . |
--push-url <url> | 终止点 --push (默认 : https://app.the-doctor.report/api/v1/findings) (中文(简体) ). |
--api-key <key> | API 用于 SaaS 的密钥,作为 x-api-key 头曰. |
--annotations | 释放 GitHub 动作 ::error:: 编号 : ::warning:: 线条. |
--ci | 自动允许的CI行为(GitHub Actions上的注释). |
--no-ci | 禁用 CI 自动检测, 即使设置了 CI 内存 . |
--diff | 仅报告文件中的发现已更改 . |
--staged | 只报告已存档的发现 . |
--full | 强制进行完整的扫描, 覆盖 --diff 编号 : --staged。 。 。 . |
--output <file> | 将报告写入文件而不是 stdout . |
严重性是 error | warn | info 到处都是. --diff编号 :--staged, (中文(简体) ), --verbose编号 :--quiet,以及 --score编号 :--json 两者相互排斥.
子命令
| 命令 | 说明 |
|---|---|
list-rules | 列出所有注册规则,并列出编号、严重程度、类别、来源和预设成员。 过滤器 : --preset <recommended|all>, (中文(简体) ), --category <name>, (中文(简体) ), --source <doctor|oxlint-builtin|eslint-plugin-vue>, (中文(简体) ), --severity <error|warn|info>, (中文(简体) ), --json, (中文(简体) ), --json-compact。 。 。 . |
explain <ruleId> | 打印规则的严厉性,类别,推荐,帮助 URL. --json 用于结构化输出. |
inspect [dir] | 打印检测到的项目能力 医生用于门规则. --json 编号 : --json-compact。 。 。 . |
vue-doctor list-rules --category ai-slop
vue-doctor explain vue-doctor/no-em-dash-in-string
vue-doctor inspect --json
退出代码
| 代码 | 含义 |
|---|---|
0 | 干净, 或得分在/ 以上 --threshold 和无结果 --fail-on。 。 。 . |
1 | 调查结果 --fail-on 级别( 默认 ): error),或以下的分数 --threshold。 。 。 . |
2 | 配置错误或扫描失败 . |
规则
vue-doctor 船舶 ~24 Vue规则加克林特的本地人 vue 内置,按类别分类: ai-slop, (中文(简体) ), reactivity, (中文(简体) ), composition, (中文(简体) ), performance, (中文(简体) ), template, (中文(简体) ), template-perf, (中文(简体) ), build-quality, (中文(简体) ), deps, (中文(简体) ), sfc,以及 dead-code运行 vue-doctor list-rules 为现场名单。 大部分都在电视上 recommended 预设.
范围
仅存Vue 3. Nuxt 4 项目, 使用 @geoql/nuxt-doctor,哪个层 Nuxt 规则在本集之上.
建筑
见 docs/SPEC.md 第10条.
许可证
麻省理工学院