Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extract)!: detect 'type-only' with inline imports/exports - BREA…
…KING (#875) ## Description Detect dependencies extracted from TypeScript as `'type-only'` also when all of the inline imports/re-exports are qualified as `type`. ## Motivation and Context [TypeScript 4.5 added inline type imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names). `dependency-cruiser` has support for `'type-only'` in `dependencyTypesNot`, but this only works when using type import statements, and not when regular import statements have all their inline imports qualified as `type`. This can be fixed by moving the individual type imports to a separate type import statement, but this is cumbersome for some of us since using [ESLint's consistent-type-imports with `fixStyle: 'inline-type-imports'`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md#fixstyle) will prefer adding `type` inline even when all imports are `type`. By extension this PR also implements the functionality for inline type re-exports. Closes #873. ## How Has This Been Tested? - [x] green ci - [x] additional unit tests ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Documentation only change - [ ] Refactor (non-breaking change which fixes an issue without changing functionality) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist - [x] 📖 - My change doesn't require a documentation update, or ... - it _does_ and I have updated it - [x] ⚖️ - The contribution will be subject to [The MIT license](https://github.com/sverweij/dependency-cruiser/blob/main/LICENSE), and I'm OK with that. - The contribution is my own original work. - I am ok with the stuff in [**CONTRIBUTING.md**](https://github.com/sverweij/dependency-cruiser/blob/main/.github/CONTRIBUTING.md). --------- Co-authored-by: Sander Verweij <sverweij@users.noreply.github.com>
- Loading branch information