You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: check imports and barrels in the layer validator #25
The validator reads only pubspec.yaml files. Several rules in the reference are about what packages import and export, and can be checked by scanning import and export directives in lib/**/*.dart with a regular expression. That keeps the script dependency-free (dart:io only).
Requirements
Cross-feature presentation imports target a dedicated barrel. A dependency on another feature's _presentation "has to target a dedicated barrel" (Dependency rules in project_structure.md, and Widgets that own state in presentation.md). Flag package:cart_presentation/cart_presentation.dart imported from another feature, and accept a subfeature barrel such as package:cart_presentation/cart_badge.dart.
No imports of another package's src/.package:x/src/... imported from outside x is an error. Implemented in feat(validator): check imports and barrels #31 as deep-import, which covers any import past a root barrel, since the reference's own layout puts folders directly under lib/.
The data barrel does not export internals.{f}_data.dart must not export data sources, DTOs or mappers (data.md).
Each layer has a primary barrel.lib/{feature}_{layer}.dart exists (project_structure.md). Implemented in feat(validator): check imports and barrels #31 as lib/{package}.dart, which also fits backend packages such as auth_data_firebase.
Incremental mode (--file) and full mode (--all) both run the new checks. Decide whether the hook should also run on .dart edits, or only on pubspec edits. Decided in feat(validator): check imports and barrels #31: the hook runs on .dart edits and reports only the findings located in the edited file.
Each rule has a fixture and a test case.
The Hooks section of README.md and the ## Hooks section of CLAUDE.md are updated if the hook's trigger changes.
All CI/CD checks are passing.
There is no drop in the test coverage percentage.
Additional Context
The ffca-layer-auditor agent covers barrel hygiene and DTO leakage with an LLM today. Once these checks are deterministic, the agent can rely on the validator's output for them.
Activity