v9.24.0
🌟 Features
- 59fdb49 feature(validate): adds a dependents count validation (#449) - thanks @davidparkagoda for the suggestion and the first validation!
- 641a7c2 feature(enrich): adds dependents to each module (#446)
With these changes you can now define rules on the number of dependents a module must have. E.g. with this rule in the forbidden
section, you can ensure modules in the shared
folder are used at least twice (and if it drops below that you can move them to the sole dependent or remove the module altogether):
// ...
{
name: "no-unshared-in-shared",
from: {
path: "^src",
pathNot: "^src/shared"
},
module: {
path: "^src/shared",
numberOfDependentsLessThan: 2
}
},
// ...
You can read more about it in the rules reference on dependents rules and in the illustrated recipes.