Version: react-doctor 0.9.12
unused-file flags directory barrel files (index.ts re-exports) that are actually reachable through directory-path imports.
Repro shape:
src/features/foo/index.ts // export * from "./foo-list"; export * from "./foo-card"
src/screens/bar.tsx // import { FooList } from "@/features/foo"
The barrel is imported via the directory specifier (@/features/foo → resolved by TS/bundler to foo/index.ts), but dead-code analysis reports src/features/foo/index.ts as an unused file. Deleting it breaks the build, so the finding is a false positive.
Likely the resolver isn't applying Node/TS directory-index resolution (or the project's paths aliases) when building the import graph for dead-code analysis. We confirmed this on a Next.js app with @/* path alias in tsconfig.json.
Version: react-doctor 0.9.12
unused-fileflags directory barrel files (index.tsre-exports) that are actually reachable through directory-path imports.Repro shape:
The barrel is imported via the directory specifier (
@/features/foo→ resolved by TS/bundler tofoo/index.ts), but dead-code analysis reportssrc/features/foo/index.tsas an unused file. Deleting it breaks the build, so the finding is a false positive.Likely the resolver isn't applying Node/TS directory-index resolution (or the project's
pathsaliases) when building the import graph for dead-code analysis. We confirmed this on a Next.js app with@/*path alias intsconfig.json.