Comment by rickcarlino
Comment by rickcarlino 16 hours ago
Will it remove exports that are only imported for the sake of testing? Eg: it is only imported by files ending in .test.ts or with __test__ as a parent directory?
I’ve tried tools like this in the past within projects that have high test coverage but I have never had any luck because of this edge case.
I may be opinionated but I believe that the best practice is to configure a separate tsconfig for test files with project references. As long as the test files are not included in the tsconfig passed to ts-remove-unused, it should remove exports that are only used in test files.
https://www.typescriptlang.org/docs/handbook/project-referen...