Skip to content

.syncpackrc

Configuration File

Syncpack uses cosmiconfig to search the current and ancestor directories for a:

  • .syncpackrc file in JSON or YAML format.
  • .syncpackrc.json, .syncpackrc.yaml, .syncpackrc.yml, .syncpackrc.js, .syncpackrc.cjs, syncpack.config.js, syncpack.config.cjs file.
  • config.syncpack or syncpack property in package.json.

A custom name and location can be provided instead:

Terminal window
syncpack list --config ./config/syncpack.json

Defaults

Your config file only needs to define values for those you want to change from the defaults below.

.syncpackrc.js
// @ts-check
/** @type {import("syncpack").RcFile} */
const config = {
customTypes: {
dev: {
strategy: 'versionsByName',
path: 'devDependencies',
},
local: {
strategy: 'name~version',
namePath: 'name',
path: 'version',
},
overrides: {
strategy: 'versionsByName',
path: 'overrides',
},
peer: {
strategy: 'versionsByName',
path: 'peerDependencies',
},
pnpmOverrides: {
strategy: 'versionsByName',
path: 'pnpm.overrides',
},
prod: {
strategy: 'versionsByName',
path: 'dependencies',
},
resolutions: {
strategy: 'versionsByName',
path: 'resolutions',
},
},
dependencyTypes: ['**'],
filter: '.',
formatBugs: true,
formatRepository: true,
indent: ' ',
semverGroups: [],
sortAz: ['bin', 'contributors', 'dependencies', 'devDependencies', 'keywords', 'peerDependencies', 'resolutions', 'scripts'],
sortExports: ['types', 'node-addons', 'node', 'browser', 'import', 'require', 'development', 'production', 'default'],
sortFirst: ['name', 'description', 'version', 'author'],
sortPackages: true,
source: ['package.json', 'packages/*/package.json'],
specifierTypes: ['**'],
versionGroups: [],
};
module.exports = config;