2

We already have set up eslint rules (no-unused-vars) to detect unused vars and also unused imports. What we are struggling to find is unused components, state management codes, css styles and unused service methods.

I am trying to find a command / package which will scan through all our codebase and find these unused codes.

1 Answers1

0

You can try to run this command:

npx depcheck

https://www.npmjs.com/package/depcheck

I just tried it yesterday, because my coworker mentioned it. As far as he told me, it checks package.json for unused dependencies, but I saw that it listed out some components for me as well. I think it's quite close to what you are looking for.

rkristof
  • 55
  • 5