Documentation menu

Commands

flog check depsEXPERIMENTAL

Experimental: This check may change before stabilization. It remains read-only and withholds findings when possible uses are unobserved.

Conservatively find unused dependency declarations in one workspace.

Usage#

flog check deps --workspace <selector> [--json]

Examples#

flog check deps --workspace apps/website
flog check deps --workspace @example/library --json

Coverage and uncertainty#

This command reuses the bounded import-use analysis from flog check imports. It observes static package imports in regular executable .ts files, retaining runtime and type-only uses with exact locations. A type-only use counts as use; it does not automatically move a package into devDependencies.

Only dependencies and devDependencies are candidates for unused findings. Peer and optional dependency policy is intentionally deferred.

An unused finding is emitted only when the bounded evidence is sufficient. The check is incomplete when Stick cannot analyze relevant source, a static re-export is present, package scripts exist, an active non-.ts workspace file could use dependencies, or unrecognized package configuration could name tools or plugins. CommonJS require calls, TypeScript triple-slash type/path and AMD dependency directives, package aliases, absolute imports, and relative imports escaping the selected workspace are also incomplete. Markdown and other inert documentation files do not reduce coverage. Incomplete reports retain observed imports and explicit uncertainty reasons but contain no unused findings.

This first slice does not infer tooling use, execute scripts, resolve project configuration, or scan JavaScript, declarations, TSX, dynamic imports, and re-exports for dependency use.

Output and exits#

Human output states bounded coverage, uncertainty, and defensible findings. --json emits a versioned report containing the workspace, scanned files, observed uses, findings, and uncertainty reasons.

Exit status 0 means the check completed with no findings. Defensible unused declarations exit 1 after the report is written. Usage errors exit 2. Incomplete analysis exits 5 and can never present an unused label or clean result.

Run flog check deps --help for complete current help.

flog check · flog check imports