Query module UnusedDependency

name
Unused npm dependency
description
If unnecessary package dependencies are included in package.json, the package will become harder to install.
kind
problem
problem.severity
warning
id
js/node/unused-npm-dependency
tags
maintainability frameworks/node.js
precision
medium

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Predicates

declaresDependency

Holds if the NPM package pkg declares a dependency on package name, and dep is the corresponding declaration in the package.json file.

getAPathExpr

Gets a path expression in a module belonging to pkg.

getAURLAttribute

Gets a URL-valued attribute in a module or HTML file belonging to pkg.

getPackageScriptNameWithDependency

Gets the name of a script in the ‘scripts’ object of pkg. The script makes use of a declared dependency of pkg.

implicitRequire

Holds if pkg implicitly requires module name.

usesDependency

Holds if the NPM package pkg declares a dependency on package name, and uses it at least once.