Skip to content

feat(folder-structure-cruiser): allow imports from direct children#273

Draft
Komoszek wants to merge 5 commits into
mainfrom
szpont/direct-children-import-option-962a
Draft

feat(folder-structure-cruiser): allow imports from direct children#273
Komoszek wants to merge 5 commits into
mainfrom
szpont/direct-children-import-option-962a

Conversation

@Komoszek
Copy link
Copy Markdown
Contributor

@Komoszek Komoszek commented May 12, 2026

Summary

  • move direct-children import allowances to dependency-cruiser config (options.folderStructureCruiser.crossFeatureImports.allowImportsFromDirectChildrenOf)
  • remove the dedicated CLI flag for this behavior
  • load this setting from dependency-cruiser established options flow (with extends support) before running cross-feature validation
  • update tests to use a config fixture and refresh README examples accordingly
  • fix CI lint findings in the new config-loading code

Testing

  • npx nx lint folder-structure-cruiser
  • npx nx test folder-structure-cruiser

Slack Thread

Open in Web Open in Cursor 

- `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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cursoragent this should be a part of config file if possible, not separate cli options

Copy link
Copy Markdown

@cursor cursor Bot May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Open in Web Open in Cursor 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants