antoine-coulon / skott

All-in-one devtool to automatically analyze, search and visualize project modules and dependencies from JavaScript, TypeScript (JSX/TSX) and Node.js (ES6, CommonJS)
MIT License
669 stars 25 forks source link

Allow "import { type X }" to be part of the "typeOnly" tracking process #102

Closed antoine-coulon closed 1 year ago

antoine-coulon commented 1 year ago

Currently, there is the --trackTypeOnlyDependencies CLI flag and dependencyTracking: { typeOnly: boolean } API option both supposed to turn on/off the type-level dependency tracking.

However, this only supports TypeScript import type { X } while type-level imports can also be expressed as import { type X }.

Goal of the issue: discard modules imported using import { type X } from the graph when the config says so.