-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Milestone
Description
Glossary
- "External module" -
entity/foo <-> entity/bar
,entity/foo <-> shared/ui/button
- "Internal module" -
entity/foo <-> entity/foo/ui
,entity/foo/ui/smth <-> entitiy/foo/lib
Description
- Restrict relative imports for external modules (enforce for internalmodules)
- Restrict absolute imports for internalmodules (enforce for external modules)
Example
// Fail 👎
// @path features/baz/model/index.ts
import { ... } from "../../bar" // Sibling feature-slice
import { ... } from "@/features/baz/model/smth" // Invalid access to internal resource as external module
// Pass 👍
// @path features/baz/model/index.ts
import { ... } from "../lib" // Import of internal module as internal resource - no illegal
import { ... } from "../entities/foo" // Lower layer slice - no illegal
import { ... } from "@entities/foo" // Import as external module
import { ... } from "shared/ui/button" // Import as external module
Reference
KrakazybikKrakazybikKrakazybik
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed