The .pdcrc.json file is the configuration file that controls how peer-dependency-checker behaves in your project. It's automatically created when you run pdc setup, but you can customize it to fit your needs.
When you run setup, this file is created:
{
"packageManager": "npm",
"riskTolerance": "medium",
"autoCheck": true,
"checkOnInstall": true,
"checkOnUpgrade": true,
"excludePackages": [],
"includeDevDependencies": true,
"outputFormat": "colored"
}Default: Auto-detected
Options: "npm", "yarn", "pnpm", "bun"
Specifies which package manager you're using. Usually auto-detected based on lock files.
{
"packageManager": "pnpm"
}Default: "medium"
Options: "low", "medium", "high"
Controls how strict the compatibility checking is:
"low"- Very conservative, warns about any potential issues"medium"- Balanced approach, focuses on likely problems"high"- Only warns about definite conflicts
{
"riskTolerance": "low"
}Default: true
Whether to automatically run compatibility checks during package installation.
{
"autoCheck": false // Disable automatic checking
}Default: true
Run pre-install compatibility checks before installing new packages.
{
"checkOnInstall": true
}Default: true
Run checks when upgrading existing packages to new versions.
{
"checkOnUpgrade": false // Skip checks for upgrades
}Default: []
List of packages to skip during compatibility checking. Useful for legacy packages or known problematic dependencies.
{
"excludePackages": ["legacy-package", "problematic-dep"]
}Default: true
Whether to include devDependencies in compatibility analysis.
{
"includeDevDependencies": false // Only check production deps
}Default: "colored"
Options: "colored", "json", "minimal"
Controls the output format of compatibility reports:
"colored"- Rich, colored terminal output with emojis"json"- Machine-readable JSON output"minimal"- Simple text output without colors
{
"outputFormat": "json"
}{
"packageManager": "npm",
"riskTolerance": "low",
"autoCheck": true,
"checkOnInstall": true,
"checkOnUpgrade": true,
"excludePackages": [],
"includeDevDependencies": true,
"outputFormat": "colored"
}{
"packageManager": "npm",
"riskTolerance": "medium",
"autoCheck": true,
"checkOnInstall": true,
"checkOnUpgrade": true,
"excludePackages": ["legacy-dep"],
"includeDevDependencies": false,
"outputFormat": "json"
}{
"packageManager": "bun",
"riskTolerance": "high",
"autoCheck": false,
"checkOnInstall": false,
"checkOnUpgrade": true,
"excludePackages": [],
"includeDevDependencies": true,
"outputFormat": "minimal"
}{
"packageManager": "pnpm",
"riskTolerance": "medium",
"autoCheck": true,
"checkOnInstall": true,
"checkOnUpgrade": true,
"excludePackages": ["workspace-*"],
"includeDevDependencies": true,
"outputFormat": "colored"
}You can also add these additional options:
Default: 30000 (30 seconds)
Timeout for network requests when checking package information.
{
"timeout": 60000 // 1 minute timeout
}Default: Uses npm default registry
Custom npm registry URL for package information.
{
"registry": "https://registry.npmjs.org/"
}Default: ".pdc-cache"
Directory to store cached package information.
{
"cacheDirectory": "./node_modules/.cache/pdc"
}Default: "info"
Options: "silent", "error", "warn", "info", "debug"
Control logging verbosity.
{
"logLevel": "debug" // Verbose logging
}The .pdcrc.json file should be placed in your project root directory (same level as package.json).
my-project/
├── package.json
├── .pdcrc.json ← Configuration file
├── node_modules/
└── src/
peer-dependency-checker looks for configuration in this order:
.pdcrc.jsonfile (highest priority)package.json"pdc"field- Command line flags (override specific options)
- Default values (lowest priority)
{
"name": "my-project",
"pdc": {
"riskTolerance": "low",
"excludePackages": ["legacy-dep"]
}
}Test your configuration with:
# Check current config
pdc config
# Test with your settings
pdc scan --config .pdcrc.json
# Override specific settings
pdc scan --risk-tolerance low --output-format jsonConfig not being used?
- Make sure
.pdcrc.jsonis in project root - Check JSON syntax with
jsonlint .pdcrc.json - Verify file permissions are readable
Package manager not detected?
- Explicitly set
"packageManager"in config - Make sure lock files exist in project root
Checks too strict/lenient?
- Adjust
"riskTolerance"setting - Use
"excludePackages"for problematic dependencies
The .pdcrc.json file gives you full control over how peer-dependency-checker works in your project, allowing you to balance safety with development speed!