# @geoql/nuxt-doctor 中文文档

规范地址：https://npmcn.com/package/%40geoql/nuxt-doctor/

版本：1\.10\.0
npm 元数据更新时间：2026-11-04T06:50:06.312Z
中文译文更新时间：2026-11-16T04:50:11.309Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40geoql/nuxt-doctor
原文对照：https://npmcn.com/package/%40geoql/nuxt-doctor/?lang=original
项目主页：https://github.com/geoql/doctor#readme
源码仓库：https://github.com/geoql/doctor

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：141 kB，7 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=24
- 运行依赖：8 个
- 首次发布：2026-06-02T20:50:24.861Z
- 最新版本发布：2026-11-04T06:50:05.945Z
- 近 30 天下载量：6127（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：27（近 12 个月 27 个）

## 中文简介

Nuxt 4应用程序的CLI审计员. 通过@vue/compiller-sfc + oxlint 侦测出反标、AI-slop 和最佳实践违规行为。 运行 `npx -y @geoql/nuxt-doctor`。 。 。 .

## 安装

```sh
npm install @geoql/nuxt-doctor
```

也可以使用：`pnpm add @geoql/nuxt-doctor`、`yarn add @geoql/nuxt-doctor`、`bun add @geoql/nuxt-doctor`

## README

# `@geoql/nuxt-doctor`

> 你的经纪人写坏Nuxt。 这个接住它.

Nuxt 4应用程序的CLI审计员. 它运行的混合扫描 与 [`@geoql/vue-doctor`](https://npmcn.com/package/%40geoql/vue-doctor) ——模板-AST通过 `@vue/compiler-sfc` 加一个脚本通过 `oxlint` ——并分层Nuxt特定检查(水分,服务器路由,硝基,SEO,Cloudflare,数据比对)于上,再将所有东西合并为确定分数0-100. 用于捕捉SSR和自动导入错误编码代理留下.

## 安装

```sh
# one-off, no install
npx -y @geoql/nuxt-doctor

# or add it
npm i @geoql/nuxt-doctor
```

发表于 [无](https://www.npmjs.com/package/@geoql/nuxt-doctor) 财务报告和审定财务报表 [日 尔](https://jsr.io/@geoql/nuxt-doctor) 与出处.

## 使用量

```sh
nuxt-doctor [path] [options]
```

`path` 默认为当前目录。 默认输出格式为 `agent` (compact,为LLM消耗而建),不是动词人类报告.

```sh
# 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`。 。 。 . |

```sh
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`](https://npmcn.com/package/%40geoql/vue-doctor)。 。 。 .

## 建筑

见 [`docs/SPEC.md`](https://npmcn.com/package/docs/SPEC.md) 第10条.

## 许可证

麻省理工学院

## 常见问题

### @geoql/nuxt-doctor 是什么？

Nuxt 4应用程序的CLI审计员\. 通过@vue/compiller-sfc \+ oxlint 侦测出反标、AI-slop 和最佳实践违规行为。 运行 npx -y @geoql/nuxt-doctor。 。 。 \.

### 如何安装 @geoql/nuxt-doctor？

在项目目录运行 npm install @geoql/nuxt-doctor，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 nuxt-doctor，可以用 npx nuxt-doctor 直接运行。

### @geoql/nuxt-doctor 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @geoql/nuxt-doctor 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @geoql/nuxt-doctor 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=24。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @geoql/nuxt-doctor 可以商用吗？

@geoql/nuxt-doctor 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @geoql/nuxt-doctor 的下载量有多少？

根据 npm 官方下载统计，@geoql/nuxt-doctor 在 2026/10/16 – 2026/11/14 这 30 天内被下载 6,127 次，日均约 204 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @geoql/nuxt-doctor 还在维护吗？

最新版本 1\.10\.0 发布于 2026/11/04（11 天前）；至今共发布 27 个版本，其中过去 12 个月发布了 27 个；首次发布于 2026/06/03。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

