valid-peerDependenciesMeta
💼 This rule is enabled in the following configs: ✅ recommended, 📦 recommended-publishable.
This rule uses package-json-validator to validate the peerDependenciesMeta property, if present, against the following criteria:
- The value is an object
- Each property’s key is a valid package name
- Each property’s value is an object
- The metadata object for each package should only have the
optionalproperty - The value of the
optionalproperty should be a boolean
Examples
Section titled “Examples”{ "peerDependenciesMeta": { "typescript": true }}{ "peerDependenciesMeta": { "typescript": { "optional": true } }}Related Rules
Section titled “Related Rules”require-peerDependenciesMeta- Enforces that thepeerDependenciesMetaproperty is present.valid-peerDependenciesMeta-relationship- Enforces that every dependency declared insidepeerDependenciesMetais also declared inpeerDependencies.