0

In large repos, an entire directory may contain many files (js modules). Together, these modules implement a particular feature that is meant to be consumed only from the index.js file at the root of that feature's directory.

However, it's all to easy to import from a module considered part of the "private" API of that feature. Is there a way to prevent or warn about imports that access "private" modules not intended to be consumed by modules that are not part of the feature's implementation?

Ideally, an approach that only uses code and does not rely on external tools like linters would be great.

aryzing
  • 4,982
  • 7
  • 39
  • 42

0 Answers0