Skip to content

Comments

Add --package-json flag to specify custom package.json directory#32

Open
ponytojas wants to merge 4 commits intomillionco:mainfrom
ponytojas:feature/custom-package-json-directory
Open

Add --package-json flag to specify custom package.json directory#32
ponytojas wants to merge 4 commits intomillionco:mainfrom
ponytojas:feature/custom-package-json-directory

Conversation

@ponytojas
Copy link

Summary

  • Add --package-json CLI flag for projects where package.json lives in a different directory than the scan target
    • When provided, package.json is read from the custom directory while source file counting, tsconfig detection, and config
      file detection still use the scan directory
    • Flag is also exposed in the programmatic API via packageJsonDirectory on DiagnoseOptions

Motivation

In my company we work in a custom monorepo setup and the package.json containing React dependencies is not located with the source code to being scanned. Without this flag, react-doctor fails because it can't find package.json in the scan target.

Usage

npx react-doctor ./apps/my-app --package-json ./

@vercel
Copy link

vercel bot commented Feb 18, 2026

@ponytojas is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

@julianpleli
Copy link

nice feature 🚀 @ponytojas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants