0.18
Barrel-less Modules
This version introduces barrel-less modules, which are disabled by default. To enable them, set enableBarrelLess: true
in sheriff.config.ts
.
Barrel-less modules are not automatically set; they need to be defined in sheriff.config.ts
. Unlike the previous barrel modules, barrel-less modules don't have an index.ts
file. Instead, all files located in the internal
subdirectory are encapsulated and not accessible from other modules.
Barrel modules are still supported and detected automatically. Access to barrel-less modules is done directly, without an index.ts
file.
For more information, see the Module Boundaries.
Renaming tagging
to modules
and Deprecation of the tagging
Property
With barrel modules, the tagging
property was used to assign tags to modules. If a module wasn't tagged, it was automatically assigned the noTag
tag.
For barrel-less modules, the tagging
property defines the modules. This means future module-based settings will also be handled through tagging
.
To clarify that tagging
is the actual definition of the modules, the tagging
property has been deprecated and renamed to modules
.
The tagging
property still works, but we recommend renaming it to modules
. No other changes are required.
Renaming of "Deep Import" to "Encapsulation Violation"
Since in barrel-less modules, every access is a deep import but can still be valid, the ESLint rule "Deep Import" has been renamed to "Encapsulation Violation". The "Deep Import" rule still works but is deprecated.
CLI
verify
uses now the term "Encapsulation Violations" instead of "Deep Imports".export
includes the module type. Even if barrel-less modules are disabled, root is marked as barrel-less.