Skip to content

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.

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.

{
"peerDependencies": {
"eslint": ">=9.0.0"
}
}