Skip to content

Ignored

Have syncpack ignore the versions of these dependencies completely.

Examples

Example: Ignore one or more dependencies

Ignore one or more dependencies so that syncpack does not inspect them.

1. Add an ignored version group

  • Match 2 specific packages in the repo.
  • Match only the peerDependencies in those packages.
  • Add a label to document the decision/expectation.
.syncpackrc
{
"versionGroups": [
{
"label": "Nothing to see here, will fix soon",
"packages": ["oops-moment", "workaround"],
"dependencyTypes": ["peer"],
"isIgnored": true
}
]
}

With this configuration in place, syncpack will now completely ignore every dependency listed under peerDependencies in the two named packages oops-moment and workaround only.

Configuration

isIgnored

Required

This property activates this behaviour for a given Version Group.

.syncpackrc
{
"versionGroups": [
{
"dependencies": ["keep-walking"],
"isIgnored": true
}
]
}

dependencies

Optional
  • An array of names of dependencies you’ve installed or otherwise reference in your package.json files.
  • If omitted, the default behaviour is to match every dependency.
  • The strings can be any combination of exact matches or minimatch glob patterns:
Examples of valid values
// match any dependency
dependencies: ["**"]
// match all dependencies with a certain scope
dependencies: ["@aws-sdk/**"]
// match specific dependencies by name
dependencies: ["react", "react-dom"]
Where this pattern is matched against
{
"name": "HERE",
"dependencies": { "HERE": "0.0.0" },
"devDependencies": { "HERE": "0.0.0" },
"overrides": { "HERE": "0.0.0" },
"peerDependencies": { "HERE": "0.0.0" },
"pnpm": { "overrides": { "HERE": "0.0.0" } },
"resolutions": { "HERE": "0.0.0" }
}

dependencyTypes

Optional
  • When set, only dependencies present in the named locations will be assigned to this group.
  • If omitted, the default behaviour is to match dependencies everywhere they are found.
  • Negated types are also supported, so a value of ["!dev", "!prod"] would assign everything except dependencies and devDependencies to this group.

Default values

ValueProperty in package.json
devdevDependencies
localversion
overridesoverrides
peerpeerDependencies
pnpmOverridespnpm.overrides
proddependencies
resolutionsresolutions

specifierTypes

Optional
  • When set, only dependencies whose version specifier matches the named formats will be assigned to this group.
  • If omitted, the default behaviour is to match all dependencies.
  • Negated types are also supported, so a value of ["!latest", "!file"] would assign everything except specifiers of the format * and file:path/to/package.tgz to this group.

Available values

ValueExample
aliasnpm:foo@1.2.3
exact8.1.2
filefile:path/to/foo.tgz, file:path/to/directory
hosted-gitgit+https://github.com/user/foo, git+ssh://git@notgithub.com/user/foo#1.2.3 etc
latest* or latest
range^4.1.1, >=5.0.0, ~1.2.1 etc
tagalpha, canary
unsupported$typescript, 1.typo.wat
urlhttps://server.com/foo.tgz
workspace-protocolworkspace:*, workspace:~, workspace:^

label

Optional
  • A short name or description displayed as a header in syncpack’s output.
  • If a label is not set then eg. “Version Group 3” will be used instead.

packages

Optional
  • An array of strings which should match the name properties of your package.json files.
  • If omitted, the default behaviour is to match every package.
  • The strings can be any combination of exact matches or minimatch glob patterns:
Examples of valid values
// ✅ match any package name
packages: ["**"]
// ✅ match any package name with this scope
packages: ["@my-repo/**"]
// ✅ match specific packages by name
packages: ["my-server", "my-client"]
// ❌ not file system paths, name properties of package.json files
packages: ["packages/my-client"]
// ❌ not file system globs, name properties of package.json files
packages: ["packages/**"]
Where this pattern is matched against
{
"name": "HERE",
"version": "1.0.2"
}