🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

check-yarn-lock

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-yarn-lock

This executable is meant to be executed as a git pre-commit hook for [npm](https://www.npmjs.com/) projects using [yarn](https://yarnpkg.com/en/).

0.1.1
Source
npm
Version published
Weekly downloads
4.3K
-2.63%
Maintainers
1
Weekly downloads
 
Created
Source

Enforce committing yarn.lock when changing dependencies

This executable is meant to be executed as a git pre-commit hook for npm projects using yarn.

Whenever changes are made to one of package.json's dependency properties, if no change is staged in yarn.lock as well, this program emits an error message.

Usage

To use a commit hook, add an execution check-yarn-lock to your repository's pre-commit hook. This can be made easier using husky.

Caveats

The current implementation of this module is meant to cover all common cases, but it is not 100% fool-proof as it does not check internal yarn.lock structure:

  • If there are both staged and unstaged changes to package.json, the check might pass when it should fail.
  • If package.json was changed and did not trigger changes to yarn.lock (e.g. removing a caret from the latest available version of a dependency), this check might fail when it should pass.
    • In this case, you can run git commit --no-verify to commit anyway.

FAQs

Package last updated on 13 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts