Skip to content

onmax/vite-doctor

Repository files navigation

Vite Doctor

Vite Doctor

Catch framework bugs AI agents miss. Diagnostics for Nuxt, Vue, Nitro and Vite.

pnpm dlx vite-doctor .

Docs

Usage

Run Vite Doctor from the project root:

pnpm dlx vite-doctor .

Vite Doctor reads app code, build config, project metadata, and server handlers to catch framework bugs before review. It picks the Nuxt, Vue, Nitro, or Vite diagnostics that fit your project.

Need a narrower Doctor Run? Select exact presets, one Rule, or a framework override:

pnpm dlx vite-doctor . --extends vite/recommended,vue/recommended
pnpm dlx vite-doctor . --rules nuxt/fetch/no-raw-fetch-in-setup
pnpm dlx vite-doctor . --framework nitro

For Nuxt projects, install Vite Doctor and run it through Nuxt:

pnpm add -D vite-doctor
pnpm nuxt doctor

Use --framework only when Doctor cannot identify the framework automatically.

Configuration

Standalone trusted config files can use the full Doctor config shape:

// doctor.config.ts
import { defineDoctorConfig } from "vite-doctor/config";

export default defineDoctorConfig({
  rules: {
    "vite/define/no-secret-define": "error",
  },
});

Plugin surfaces accept the same policy through host config:

// vite.config.ts
import { doctor } from "vite-doctor";

export default {
  plugins: [
    doctor({
      config: {
        rules: {
          "vite/define/no-secret-define": "error",
        },
      },
    }),
  ],
};

In Vite config, the same plugin covers Vite, Vue, and Nitro projects. Doctor picks the matching diagnostics automatically:

// vite.config.ts
import { doctor } from "vite-doctor";

export default {
  plugins: [doctor()],
};

Set framework: "nitro" only when Doctor cannot identify the framework automatically:

// vite.config.ts
import { doctor } from "vite-doctor";

export default {
  plugins: [doctor({ framework: "nitro" })],
};

Use the Nuxt module surface for Nuxt-specific configuration:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    [
      "vite-doctor/nuxt",
      {
        config: {
          rules: {
            "nuxt/routing/prefer-nuxt-useroute": "error",
          },
        },
      },
    ],
  ],
});

Development

vp run ready
vp run -r test
vp run -r build

About

Catch the AI slop your agents ship.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors