BetaViberTest is in active development — expect breaking changes.
Overview
#014highDependencies & Config
Unused Dependencies
Detects packages in package.json that are never imported in source code.
Rule ID:
unused-depsExamples#
Badpackage.json with unused dependencies
{
"dependencies": {
"react": "^19.0.0",
"next": "^15.0.0",
"lodash": "^4.17.21", // NEVER imported
"moment": "^2.30.0", // NEVER imported
"axios": "^1.7.0", // NEVER imported (using fetch)
"classnames": "^2.5.0" // NEVER imported (using clsx)
}
}GoodOnly what you actually use
{
"dependencies": {
"react": "^19.0.0",
"next": "^15.0.0"
}
}
// Removed lodash, moment, axios, classnames
// $ npm uninstall lodash moment axios classnamesWhat It Detects#
highRuntime dependency not imported anywhere
"{depName}" is listed in dependencies but never imported
Fix: Remove with: npm uninstall {depName}.
mediumDev dependency not imported anywhere
"{depName}" is listed in devDependencies but never imported
Fix: Remove with: npm uninstall {depName}.
Exclusions#
The following are automatically excluded from this rule:
- Build tools (typescript, tsup, esbuild, webpack, vite)
- Linters (eslint, biome, prettier)
- Testing CLIs (vitest, jest, cypress, playwright)
- Type definitions (@types/*)
- Git hooks (husky)
- PostCSS/Tailwind plugins
Configuration#
This rule is enabled by default. To disable it:
.vibertestrc.jsonjson
{
"rules": {
"unused-deps": {
"enabled": false
}
}
}Learn more: docs.npmjs.com/cli/v10/commands/npm-prune