Tooling
tooling/one-lockfile
A project has exactly one committed lockfile, and CI installs from it with the frozen command (npm ci, pnpm install --frozen-lockfile).
moderatemanualfe-tooling
Why
Two lockfiles (package-lock.json and pnpm-lock.yaml) disagree about versions, so developers, CI and production install different code. A missing lockfile, or a CI install that may update it, lets a new and possibly compromised version slip in between review and deploy.
Fix
Keep the lockfile of the package manager in packageManager (or the one the team uses), delete the others, commit it, and install in CI with npm ci, pnpm install --frozen-lockfile, yarn install --immutable or bun install --frozen-lockfile.
Examples
# good: CI
corepack enable 2>/dev/null; pnpm install --frozen-lockfileSources
Facts
- Id
tooling/one-lockfile- Severity
- moderate
- Check
- manual a person reviews it; the report lists it as a checklist
- Applies to
project- Taught by the skill
fe-toolingBuild, lint and format tooling- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain tooling/one-lockfile