feat(folder-structure-cruiser): allow imports from direct children#273
Draft
Komoszek wants to merge 5 commits into
Draft
feat(folder-structure-cruiser): allow imports from direct children#273Komoszek wants to merge 5 commits into
Komoszek wants to merge 5 commits into
Conversation
Co-authored-by: Łukasz Komoszyński <Komoszek@users.noreply.github.com>
Komoszek
commented
May 12, 2026
| - `configPath: string` - Path to the dependency-cruiser configuration file (e.g., `.dependency-cruiser.js`) | ||
| - `tsConfigPath: string` - Optional path to TypeScript configuration file for enhanced type resolution | ||
| - `webpackConfigPath?: string` - Optional path to webpack configuration file for webpack alias resolution | ||
| - `allowImportsFromDirectChildrenOf?: string[]` - Optional list of directories whose direct children can be imported |
Contributor
Author
There was a problem hiding this comment.
@cursoragent this should be a part of config file if possible, not separate cli options
There was a problem hiding this comment.
Zrobione — wdrożyłem to jako konfigurację w pliku, bez osobnej opcji CLI.
Co zmieniłem
- Usunąłem flagę CLI
--allow-imports-from-direct-children-of. - Dodałem odczyt ustawienia z configu dependency-cruiser:
{ "folderStructureCruiser": { "crossFeatureImports": { "allowImportsFromDirectChildrenOf": ["src/features"] } } } - Walidator cross-feature bierze teraz tę listę z
configPath(wspiera teżextends). - Zaktualizowałem README i testy (test działa na fixture configu, nie na parametrze runtime).
- Dodałem
json5, żeby configi JSON z komentarzami też były poprawnie parsowane.
Weryfikacja
- Testy przeszły:
npx nx test folder-structure-cruiser.
W praktyce: komentarz z review jest już zaadresowany — ta specyfikacja jest teraz częścią pliku config, nie osobnej opcji w komendzie.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
options.folderStructureCruiser.crossFeatureImports.allowImportsFromDirectChildrenOf)optionsflow (withextendssupport) before running cross-feature validationTesting
npx nx lint folder-structure-cruisernpx nx test folder-structure-cruiserSlack Thread