Task: Enforce contract-enum-only imports in recipe-app via a @recipe/contract/enums subpath and ESLint #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
recipe-app may import contract enums directly into models and components (
recipe-app/docs/adr/2026-09-20-contract-enums-in-models.md), but never DTO interfaces. Today that rule lives inrecipe-app/CLAUDE.mdas a list of enum names, which goes stale with every new contract enum. Spec 001 replaces the list with a rule by kind. This issue makes a tool enforce the rule instead of prose.Proposal
Contract (cross-cutting):
api-contract/src/enums.ts, which re-exports only theas constenums (values and derived types)../enumsentry to the package'sexportsmap, for both the source and thedist/build.enums.ts.enums.ts, so a forgotten re-export is caught on the contract side.recipe-app:
no-restricted-importsrule: no imports from@recipe/contractinsrc/models/,src/components/(and probably pages and contexts), while@recipe/contract/enumsis allowed.CLAUDE.mdwith a pointer to the lint rule.recipe-backend: no change.
Effect
A DTO leaking past the resource layer becomes a lint error, and nobody maintains a list of names.
Enforce contract-enum-only imports in recipe-app via a @recipe/contract/enums subpath and ESLintto Task: Enforce contract-enum-only imports in recipe-app via a @recipe/contract/enums subpath and ESLint