4.0.0 • Published 2 years ago
@netatwork/check-npm-dependencies v4.0.0
@netatwork/check-npm-dependencies
A linter for package locks.
Installation
npm i -D @netatwork/check-npm-dependenciesConfiguration
// package.json
{
...
"nawCheckNpmDependencies": {
"extends": "./some-shared-config.json",
"noDuplicates": [
"@example/*"
],
"sameVersions": [
"@example/*",
[
"example-a-*",
"example-b"
]
]
}
}- nawCheckNpmDependencies
<Config>- Can be a path to load the config from or an object with the following options:- extends
<string>- A path to load a config from to extend. - noDuplicates
<string[]>- An array of package name patterns to check for duplicates.- In the example above, all packages within the
@examplescope are checked for duplicates.
- In the example above, all packages within the
- sameVersions
<(string | string[])[]>- An array of patterns or pattern groups to ensure that all packages within a group have the same versions.- In the example above, all packages within the
@examplescope are checked for the same version andexample-a-*andexample-bare checked for the same version.
- In the example above, all packages within the
- extends
Usage
# Run via npx:
npx naw-check-npm-dependencies [...args]// Or add to your package.json:
{
"scripts": {
"test": "naw-check-npm-dependencies ..."
}
}--context | -c <path>- The path at which to look for apackage.jsonandpackage-lock.json.