@hiogawa/icheck-ts
v0.0.1-pre.21
Published
simpler [ts-prune](https://github.com/nadeesha/ts-prune) alternative.
Downloads
6
Readme
icheck-ts
simpler ts-prune alternative.
usage
$ icheck-ts --help
icheck-ts/0.0.1-pre.15
Usage:
$ icheck-ts [options] <files...>
Report unused exports
Positional arguments:
files Files to check exports
Options:
--cache Enable caching
--cacheLocation=... Cache directory location
--cacheSize=... LRU cache size
--ignore=... RegExp pattern to ignore export names
--noCheckCircular Disable checking circular import
$ icheck-ts fixtures/cli/*.ts
** Unused exports **
fixtures/cli/x2.ts:3 - b
** Circular imports **
fixtures/cli/cycle4.ts:2 - x
-> fixtures/cli/cycle2.ts:2 - (side effect)
-> fixtures/cli/cycle3.ts:2 - *
features
- check unused exports
- check circular dependencies
- only dependency is
typescript
(peerDependencies
) for parsing - support
// icheck-ignore
to silence specific export line
not supported
- namespace re-export usages are not checked (e.g.
export * from "./abc"
) - no typescript custom resolution e.g. tsconfig
baseUrl
,paths
, etc...
development
# release
pnpm build
pnpm release
# dev
npx tsx ./src/cli.ts $(find fixtures/ytsub-v3/app -name '*.ts' -o -name '*.tsx')
npx tsx ./src/cli.ts fixtures/ytsub-v3/app/routes/index.tsx fixtures/ytsub-v3/app/utils/loader-utils.ts
npx tsx ./src/cli.ts $(git grep -l . src)
# import.meta.resolve mode
npx tsx --experimental-import-meta-resolve ./src/cli.ts --useImportMetaResolve fixtures/ytsub-v3/app/routes/index.tsx fixtures/ytsub-v3/app/utils/loader-utils.ts
npx tsx --experimental-import-meta-resolve ./src/cli.ts --useImportMetaResolve $(git grep -l . src)
node --experimental-import-meta-resolve ./bin/cli.js --useImportMetaResolve fixtures/ytsub-v3/app/routes/index.tsx fixtures/ytsub-v3/app/utils/loader-utils.ts
node --experimental-import-meta-resolve --loader tsx/esm ./bin/cli.js --useImportMetaResolve fixtures/ytsub-v3/app/routes/index.tsx fixtures/ytsub-v3/app/utils/loader-utils.ts
npx tsx --experimental-import-meta-resolve ./bin/cli.js --useImportMetaResolve fixtures/ytsub-v3/app/routes/index.tsx fixtures/ytsub-v3/app/utils/loader-utils.ts
npx tsx --experimental-import-meta-resolve ./src/cli.ts --useImportMetaResolve $(find fixtures/resolve -type f)