lint-package-lock

Lint the package-lock file generated by npm

Usage no npm install needed!

<script type="module">
  import lintPackageLock from 'https://cdn.skypack.dev/lint-package-lock';
</script>

README

Lint Package Lock

License npm version

This is a tool to keep your package-lock sane when working with multiple devs who may be using different npm versions or .npmrc files.

Installation

npm i --save-dev lint-package-lock

Usage

It is configured using the JSON file .lint-package-lock in your home folder, details of which are in the Rules section of the readme.

Add it to your packages scripts to use it:

{
  "scripts": {
    "lint:package-lock": "lint-package-lock"
  }
}

Rules

Server

Enforces the resolves server to use, defaults to https://registry.npmjs.org

Example:

{
  "server": "https://your-private-registry.internal"
}

Arguments

--file=package-lock.json

Sets the file to lint, defaults to package-lock.json in the current working directory.

--config=.lint-package-lock

Sets the config file, defaults to .lint-package-lock in the current working directory.