This reproduces a Knip v6 path-resolution mismatch when the CLI is pointed at a non-default tsconfig file.
tsconfig.jsonhas nocompilerOptions.paths.tsconfig.app.jsonextendstsconfig.jsonand defines@app/* -> ./src/*.knip.tshas nopaths.src/main.tsimportssrc/used.tsvia@app/used.src/unused.tsis truly unused.
When running with --tsConfig tsconfig.app.json, Knip should understand @app/used and report only src/unused.ts.
pnpm install
pnpm knip
pnpm knip:with-paths
pnpm knip:use-tsconfig-filespnpm knipreports bothsrc/used.tsandsrc/unused.tsas unused.pnpm knip:with-pathsreports onlysrc/unused.ts.pnpm knip:use-tsconfig-filesreports nothing and exits0.
This suggests Knip loads tsconfig.app.json for file context, but the module resolver still does not use its compilerOptions.paths unless aliases are also present in Knip config. --use-tsconfig-files is not equivalent: it avoids the false positive, but also masks the true unused file.