Dependency Types
Dependency types refer to the different locations in package.json files where dependencies can be defined.
Default Values
Section titled “Default Values”The default dependency types in syncpack are the ones defined by npm, pnpm, and yarn:
Name | Property in package.json |
---|---|
dev | devDependencies |
local | version |
overrides | overrides |
peer | peerDependencies |
pnpmOverrides | pnpm.overrides |
prod | dependencies |
resolutions | resolutions |
Custom Values
Section titled “Custom Values”You can extend the above list by defining your own custom types, such as:
- Engine versions (
engines
) - Package manager versions (
packageManager
) - Any other nested property in package.json
Using Dependency Types
Section titled “Using Dependency Types”Dependency types can be specified in these contexts:
Command Line Filtering
Section titled “Command Line Filtering”Use the --dependency-types
option to target specific types in commands:
# Only check production dependenciessyncpack lint --dependency-types prod
# Check both production and development dependenciessyncpack lint --dependency-types prod,dev
# Check everything except peer dependenciessyncpack lint --dependency-types '!peer'
Configuration
Section titled “Configuration”Dependency types can be used to target and filter:
- Version Groups - Carve out specific version policies
- Semver Groups - Define which semver ranges to use with specific dependencies
- Dependency Groups - Merge and alias families of dependencies as one