The Pinia Rule Pack checks defineStore() calls in Vue, Vite, and Nuxt projects. Pinia is a Vue ecosystem library rather than part of Vue or Nuxt, so the pack activates on its own when Project Inventory contains pinia or @pinia/nuxt.
Install and run
Install Vite Doctor in the project:
pnpm add -D vite-doctor
The Recommended Preset runs automatically and reports store ids that more than one defineStore() call registers:
pnpm vite-doctor .
The Strict Preset adds the use<Id>Store naming convention:
pnpm vite-doctor . --extends auto,pinia/strict
To diagnose one Rule, select it with --rules. Strict-only Rules also need the Strict Preset:
pnpm vite-doctor . --rules pinia/stores/unique-store-id
pnpm vite-doctor . --extends auto,pinia/strict --rules pinia/stores/store-name-matches-id
What Doctor reads
Doctor recognizes defineStore imported from pinia, including aliased and namespace imports. It also recognizes defineStore with no import, which is how @pinia/nuxt and unplugin-auto-import expose it. Calls whose callee resolves to a local declaration or parameter are skipped, including shadowed named, aliased, and namespace imports.
Doctor only compares ids that are string literals, or template literals without expressions. Both defineStore('cart', ...) and the object form defineStore({ id: 'cart', ... }) are read. Ids built from variables or expressions are skipped.
Duplicate ids are compared across the files Doctor scans by default, so tests, fixtures, and generated files are excluded. The comparison spans workspace packages because stores imported from another package can share the app’s Pinia instance. Diagnostics have heuristic confidence: duplicate ids collide only when their definitions use the same Pinia instance. Doctor does not prove that runtime relationship; independent instances can intentionally reuse ids.