peerDependenciesMetaValidity
Enforces that the
peerDependenciesMetaproperty is valid.
✅ This rule is included in the package-json logical presets.
This rule checks that the peerDependenciesMeta property is an object.
Each peer dependency metadata value should be an object containing an optional boolean and no other properties.
Examples
Section titled “Examples”{ "peerDependenciesMeta": { "example": {} }}{ "peerDependenciesMeta": { "example": { "optional": "yes" } }}{ "peerDependenciesMeta": { "example": { "optional": true, "other": 1 } }}{ "peerDependenciesMeta": { "example": { "optional": true } }}{ "peerDependenciesMeta": { "example": { "optional": false }, "example-two": { "optional": true } }}When Not To Use It
Section titled “When Not To Use It”If you don’t need compliance with npm’s peerDependenciesMeta field specification, you can disable this rule.
For example, if your package manager supports additional metadata keys for peer dependencies, this rule may not be correct for you.
Related Rules
Section titled “Related Rules”- peerDependenciesMetaPresence - Enforces that the
peerDependenciesMetaproperty is present. - peerDependenciesValidity - Enforces that the
peerDependenciesproperty is valid.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 around the world by
the Flint team and contributors.