specify-peers-locally
💼 This rule is enabled in the following configs: ✅ recommended, 📦 recommended-publishable.
💡 This rule is manually fixable by editor suggestions.
This rule requires that all peer dependencies are also declared as dev dependencies.
More Details
Section titled “More Details”When you have a dependency declared in a package’s peerDependencies, it’s meant to be an expression of compatibility with that dependency.
It also establishes a contract with consumers of your package that they should install a version of that dependency within the range that you’ve declared.
Since you also need to use that package locally as part of development, it’s generally a best practice to declare it in the package’s devDependencies as well, so that it’s installed and available for use.
This rule requires that all dependencies declared in a package’s peerDependencies are also declared in the package’s devDependencies.
Examples
Section titled “Examples”{ "peerDependencies": { "eslint": ">=9.0.0" }}{ "peerDependencies": { "eslint": ">=9.0.0" }, "devDependencies": { "eslint": "10.4.0" }}Related Rules
Section titled “Related Rules”require-peerDependencies- Enforces that thepeerDependenciesproperty is present.valid-peerDependencies- Enforces that thepeerDependenciesproperty is valid.