Open illright opened 5 months ago
Restrict imports that go inside the slice, sidestepping the public API.
Every slice (and segment on layers that don't have slices) must contain a public API definition. Modules outside of this slice/segment can only reference the public API, not the internal file structure of the slice/segment. https://feature-sliced.design/docs/reference/slices-segments#public-api-rule-on-slices
Every slice (and segment on layers that don't have slices) must contain a public API definition.
Modules outside of this slice/segment can only reference the public API, not the internal file structure of the slice/segment. https://feature-sliced.design/docs/reference/slices-segments#public-api-rule-on-slices
Examples of imports that violate this rule:
// src/pages/home/ui/HomePage.tsx import { ArticlePreview } from "~/entities/article/ui/ArticlePreview`;
Pay attention in designing this rule that some people choose to sidestep the public API in Shared, especially shared/ui, to improve tree-shaking
shared/ui
The autofix is lower priority
Restrict imports that go inside the slice, sidestepping the public API.
Examples of imports that violate this rule:
Pay attention in designing this rule that some people choose to sidestep the public API in Shared, especially
shared/ui
, to improve tree-shaking