dependencyUniqueness
Reports dependency names that are declared more than once in package.json.
✅ This rule is included in the package-json logical presets.
This rule reports dependency names that are repeated in the same package.json dependency collection.
It also reports dependency names repeated from dependencies into devDependencies or peerDependencies.
Examples
Section titled “Examples”{ "dependencies": { "left-pad": "^1.3.0", "left-pad": "^1.3.0" }}{ "dependencies": { "left-pad": "^1.3.0" }, "devDependencies": { "left-pad": "^1.3.0" }}{ "dependencies": { "left-pad": "^1.3.0" }, "devDependencies": { "vitest": "^4.0.0" }}When Not To Use It
Section titled “When Not To Use It”If your package intentionally repeats dependency names across dependency collections, such as to mirror a runtime dependency into peerDependencies, this rule might not be for you.
Doing so is generally unnecessary with most mainstream package managers, but other tooling might add in the need to do so.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
package-json/unique-dependencies
Made with ❤️🔥 around the world by
the Flint team and contributors.