peerDependenciesMetaRelationship
Enforces that any dependencies declared in
peerDependenciesMetaare also defined in the package'speerDependencies.
✅ This rule is included in the package-json logical presets.
The rule checks that any dependencies declared in peerDependenciesMeta are also defined in the package’s peerDependencies.
peerDependenciesMeta is meant to provide metadata about peer dependencies.
So entries that do not correspond to an existing peerDependencies dependency are considered redundant.
Examples
Section titled “Examples”{ "peerDependencies": { "one-package": "^1.0.0" }, "peerDependenciesMeta": { "some-other-package": { "optional": true } }}{ "peerDependencies": { "some-package": "^1.0.0" }, "peerDependenciesMeta": { "some-package": { "optional": true } }}Suggestions
Section titled “Suggestions”When this rule reports an invalid peerDependenciesMeta entry, it provides an editor suggestion to remove that property.
Related Rules
Section titled “Related Rules”- peerDependenciesPresence - Enforces that the
peerDependenciesproperty is present.
Further Reading
Section titled “Further Reading”- npm:
package.json>peerDependenciesMeta - pnpm:
package.json>peerDependenciesMeta - Yarn:
package.json>peerDependenciesMeta
Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 around the world by
the Flint team and contributors.