Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364#!/usr/bin/env node
/** CLI entrypoint reporting workspace exports nothing references. @example ```bash unused-export unused-export --json /path/to/workspace unused-export --check ``` */
import { parseArgs, } from 'node:util';
import { findUnusedExports, } from './find-unused.ts';
/** Parsed CLI options and optional workspace root positional. */const { values, positionals,} = parseArgs({ options: { json: { type: 'boolean', default: false, }, check: { type: 'boolean', default: false, }, }, allowPositionals: true,},);
/** Workspace root under analysis, defaulting to the working directory. */const workspaceRoot = positionals[0] ?? process.cwd();
/** Exports with zero workspace references. */const findings = await findUnusedExports({ workspaceRoot, },);
if (values.json) { console.log(JSON.stringify( findings, null, 2, ),);}else { for (const finding of findings) console.log( `${finding.file}:${String(finding.line,)}:${String(finding.column,)} ${finding.typeOnly ? 'type ' : ''}${finding.name}`, );}
if (values.check && (findings.length > 0)) process.exitCode = 1;