keeping a project clean and small bundle size
- ts-prune: A command-line tool that finds unused exports in your TypeScript project. It's excellent for identifying dead code that isn't referenced by any other part of your application. You can run it with npx ts-prune.
- depcheck: This tool analyzes your project's dependencies. It checks your package.json against the code to see which dependencies are unused, missing from package.json, or should be moved to devDependencies.
- ESLint Plugin:
eslint-plugin-unused-imports: An ESLint plugin that can automatically find and remove unused imports. Your project already uses ESLint, so this can be a powerful addition to your linting process. The built-in no-unused-vars rule is also essential. - Bundle Analyzer (
@next/bundle-analyzer): For a Next.js project, this is a very useful tool. It creates a visual representation of your application's bundles, allowing you to see which modules and packages are taking up the most space. This can help you spot large or unnecessary code that has been included in your final build. - Code Coverage Reports: Your project uses Jest for testing. You can configure Jest to generate a code coverage report. Files and code blocks with 0% coverage are worth investigating, as they might be untested or completely unused.
✦The tool you're likely thinking of is npkill.
It's a popular and easy-to-use command-line tool that scans your system for node_modules directories, shows you how much space they are taking up, and allows you to select and delete them
to free up space.