An ESLint plugin for linting npm ecosystem lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lock, vlt-lock.json). Version 1.1.0 requires ESLint ^9.39.2 and Node >=22.21. Provides 6 rules including integrity verification, registry enforcement, and lockfile version/format controls. Maintained by ljharb. Differentiators: supports 5 package managers, supply-chain attack protection via integrity checks, and both flat and legacy configs.
npm install eslint-plugin-lockfileNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows full flat config setup with all rules enabled and linting a lockfile.
Migrate to flat config (ESLint 9+). Use 'plugin:lockfile/recommended-legacy' only if stuck on ESLint 8.
Use 'lockfile.configs.recommended' with flat config instead.
Use ['error', ['npm']] for a single flavor, not ['error', 'npm'].
Ensure lockfiles are valid for the detected package manager. Test with a simple lint run first.
Add exclusions for known non-standard packages or disable integrity if using private registries without hashes.
Upgrade Node.js to >=22.21, >=24.11, or >=25.2.
Run 'npm install eslint-plugin-lockfile --save-dev'
Use import statement: 'import lockfile from "eslint-plugin-lockfile"'
Configure as ['error', 'npm'] or ['error', ['npm', 'yarn']]