Registry / testing / dependency-lint

dependency-lint

JSON →
library7.1.0jsnpmunverified

Lints package.json dependencies and devDependencies by comparing declared modules against actual usage (requires, execs in scripts). Currently v7.1.0, stable with infrequent releases. Supports Node.js 12, 14, 16. Unlike depcheck, it also inspects shell scripts and npm run scripts for obvious misuse. Provides auto-correct mode and YAML configuration.

npm install dependency-lint
INSTALL
IMPORT
SIG · DEPENDENCY-LINT
D
dependency-lint
testingjavascriptv7.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dependencyLint (CLI only, no programmatic API)
✓ Call via npx dependency-lint or node_modules/.bin/dependency-lint
✗ import dependencyLint from 'dependency-lint'
The package is CLI-only. No programmatic import exists. Use child_process.exec in Node.

Run dependency-lint CLI to detect missing, unused, or mislabeled dependencies.

// No JavaScript API. Use CLI: // Run `npx dependency-lint` in project root. // Auto-correct: `npx dependency-lint --auto-correct`
dependency-lint --version
Debug
Known issues
deprecatedPackage last updated September 2021. Node.js support limited to versions 12, 14, 16. Alternative: use `depcheck` or `eslint-plugin-import` for more modern linting.
fix
Migrate to depcheck or npx check-dependencies.
affects: >=7.0
breakingVersion 7 requires Node 12+. Older versions may fail on unsupported Node versions.
fix
Use Node 12, 14, or 16, or downgrade to v6.
affects: 7.x
Errors
Common errors & fixes
dependency-lint: no configuration file found. Use --generate-config to create one.
Missing dependency-lint.yml in project root.
fix
Run `npx dependency-lint --generate-config` to create a default configuration.
Could not parse /path/to/file.js: Unexpected token
JavaScript file contains syntax not supported by the parser (e.g., Flow, JSX without proper transformer).
fix
Ensure files are plain JavaScript/TypeScript without unsupported syntax. Ignore problematic files in configuration.
Upgrade
Version history
7.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
dependency-lint — npm install dependency-lint · libregistry