Skip to content

peerDependenciesMetaValidity

Enforces that the peerDependenciesMeta property 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.

{
"peerDependenciesMeta": {
"example": {}
}
}
{
"peerDependenciesMeta": {
"example": {
"optional": "yes"
}
}
}
{
"peerDependenciesMeta": {
"example": {
"optional": true,
"other": 1
}
}
}

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.

Made with ❤️‍🔥 around the world by the Flint team and contributors.