Skip to content

no-local-dependencies

This rule enforces that no dependencies are declared with local file paths, since this will likely result in errors when installing from a registry. This includes any paths that start with file:, link:, ./, or ../.

{
"dependencies": {
"foo": "file:../foo",
"bar": "link:../bar",
"baz": "../baz"
}
}
Name Description Type Default
ignorePrivate Determines if this rule should be enforced when the package’s private property is true. Boolean true

When this option is enabled and the package has "private": true, the rule skips its check entirely. This can be useful for internal packages that won’t be published to a registry. Disable it if you want to apply the rule to all packages, regardless of privacy.

{
"package-json/no-local-dependencies": [
"error",
{
"ignorePrivate": false
}
]
}