@geoql/nuxt-doctor
你的经纪人写坏Nuxt。 这个接住它.
Nuxt 4应用程序的CLI审计员. 它运行的混合扫描 与 @geoql/vue-doctor ——模板-AST通过 @vue/compiler-sfc 加一个脚本通过 oxlint ——并分层Nuxt特定检查(水分,服务器路由,硝基,SEO,Cloudflare,数据比对)于上,再将所有东西合并为确定分数0-100. 用于捕捉SSR和自动导入错误编码代理留下.
安装
# one-off, no install
npx -y @geoql/nuxt-doctor
# or add it
npm i @geoql/nuxt-doctor
使用量
nuxt-doctor [path] [options]
path 默认为当前目录。 默认输出格式为 agent (compact,为LLM消耗而建),不是动词人类报告.
# Audit the project and print the agent report
nuxt-doctor
# Human-readable output, fail the build on warnings
nuxt-doctor --format pretty --fail-on warn
# Machine-readable, only staged files, write to a file
nuxt-doctor --json --staged --output report.json
# Just the score, for piping into a gate
nuxt-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 nuxt-doctor/seo/lang-on-html: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。 。 。 . |
nuxt-doctor list-rules --category hydration
nuxt-doctor explain nuxt-doctor/nitro/compatibilityDate-set
nuxt-doctor inspect --json
退出代码
| 代码 | 含义 |
|---|---|
0 | 干净, 或得分在/ 以上 --threshold 和无结果 --fail-on。 。 。 . |
1 | 调查结果 --fail-on 级别( 默认 ): error),或以下的分数 --threshold。 。 。 . |
2 | 配置错误或扫描失败 . |
规则
nuxt-doctor ~26 Nuxt规则 顶上 全部Vue规则,59条规则在登记处总数。 数值类别 : structure, (中文(简体) ), nitro, (中文(简体) ), seo, (中文(简体) ), cloudflare, (中文(简体) ), server-routes, (中文(简体) ), hydration, (中文(简体) ), data-fetching, (中文(简体) ), modules-deps和 Nuxt 键 ai-slop; 继承的 Vue 类别为 ai-slop, (中文(简体) ), reactivity, (中文(简体) ), composition, (中文(简体) ), performance, (中文(简体) ), template, (中文(简体) ), template-perf, (中文(简体) ), build-quality, (中文(简体) ), deps, (中文(简体) ), sfc,以及 dead-code运行 nuxt-doctor list-rules 为现场名单。 大部分都在电视上 recommended 预设.
范围
仅纳克特 4: app/ 目录布局 compatibilityVersion: 4。对于平地 Vue 3 项目,使用 @geoql/vue-doctor。 。 。 .
建筑
见 docs/SPEC.md 第10条.
许可证
麻省理工学院