noUndeclaredDependencies (not released)
Diagnostic Category: lint/nursery/noUndeclaredDependencies
Disallow the use of dependencies that aren’t specified in the package.json
.
Indirect dependencies will trigger the rule because they aren’t declared in the package.json
. This means that if package @org/foo
has a dependency on lodash
, and then you use
import "lodash"
somewhere in your project, the rule will trigger a diagnostic for this import.
Examples
Section titled ExamplesInvalid
Section titled Invalidimport "vite";