Cleaning up unused Typescript Files with `ts-prune`

2023-06-27

TLDR: npx ts-prune will find us-used files in your Typescript project!


Recently at work I had some extra time on Friday. Not enough that I wanted to start a big task, but enough time to do some cleanup.

I found ts-prune which looks through a TypeScript project and finds things that are unused. It helped me find things that were completely unused and could be cleaned up, and some types there were being exported from their file but didn't need to be!

ts-prune is in maintenance mode, but I found it to work well for my usecase!

One caveat is that it just prints the files with errors to stdout, I had to go fix the issues manually. But well worth it for a more cleaned up repo!

coreyja weekly

My weekly newsletter tailored at developers who are eager to grow with me!
Every week will be unique, but expect topics focusing around Web Development and Rust