-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I have a flutter app in which I am doing Feature Sliced Design. Feature Sliced Design prohibits cross-imports between different slices in a same layer and I would like to use this package to enforce this rule in my project.
For a slice in my layer, I want to disallow the import of all the slices in this layer except for my current slice.
For example:
Files under lib/src/entities/a cannot import files under lib/src/entities/b but still can import other files under lib/src/entities/a.
I think a rule like this in analysis_options.yaml could be appropriate:
import_rules:
rules:
- target: "lib/src/entities/**"
disallow: "lib/src/entities/**"
exclude_disallow:
- "$TARGET_DIR/../**"
reason: "No cross-imports between layers"
It would be fairly easy to accept the use of .. in the matches method of the Disallow rule. One could even use the normalize method from the path package https://pub.dev/documentation/path/latest/path/Context/normalize.html.