We are writing a JavaScript application that is becoming large. We have a few architectural rules that we would like to be able to enforce, the main use case would be something like: package A cannot require package B.
In a Java application, you might use ArchUnit to achieve something similar.
ArchUnit is a free, simple and extensible library for checking the architecture of your Java code using any plain Java unit test framework. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more.