Best Practiceswarn by defaultopt-in preset
astro-doctor/prefer-pnpmprefer-pnpm
Use pnpm consistently and remove competing package-manager lockfiles.
Why
Declaring pnpm in packageManager makes local development and CI use the same package-manager version. Keeping npm, Yarn, or Bun lockfiles alongside pnpm-lock.yaml can produce different dependency graphs and non-reproducible installs.
Examples
Incorrect
Package manager is unspecified or competing lockfiles exist
{
"name": "my-astro-project"
}
# package-lock.json also existsCorrect
Declare pnpm and keep only its lockfile
{
"name": "my-astro-project",
"packageManager": "pnpm@10.34.3"
}
# pnpm-lock.yamlConfiguration
Project audits are configured in doctor.config.ts:
export default {
rules: {
'astro-doctor/prefer-pnpm': 'error', // or 'warn' or 'off'
},
}All rules
astro-doctor/no-client-load-overuseastro-doctor/use-astro-imageastro-doctor/require-image-dimensionsastro-doctor/no-missing-altastro-doctor/no-set-htmlastro-doctor/no-public-secret-envastro-doctor/prefer-class-listastro-doctor/no-blocking-scriptastro-doctor/no-unprocessed-script-surprisesastro-doctor/no-missing-langastro-doctor/require-island-fallbackastro-doctor/no-process-envastro-doctor/prefer-content-collectionsastro-doctor/no-disabled-origin-checkastro-doctor/no-insecure-session-cookieastro-doctor/no-open-allowed-domainsastro-doctor/prefer-env-schemaastro-doctor/prefer-pnpm(this page)astro-doctor/require-action-input-schemaastro-doctor/require-client-router-script-lifecycleastro-doctor/require-content-config