Reputation: 67
I have a React application, and a bunch of no-unused-vars in the console when running it getting me nuts, so I'm kindly asking you folks to share your experience: are there any such tools or no.
Upvotes: 2
Views: 7239
Reputation: 122
When projects get large its a pain to manage old code, what I did is to write a script to find unused exports (these will not be picked up by eslint) it should show you where you have a export that is not imported anywhere
just run:
npx dead-exports
assuming that your code is in ./src
read more here:
https://www.npmjs.com/package/dead-exports
Upvotes: 7
Reputation: 21
Use vs code with and ES7 React/Redux/GraphQL/React-Native snippets proper code formatter like prettier and you will find unused components in different color as compared to used component
Upvotes: 0