How to find dead code in a large react project?

后端 未结 8 604
执笔经年
执笔经年 2020-12-25 12:47

In order to refactor a client-side project, i\'m looking for a safe way to find (and delete) unused code.

What tools do you use to find unused/dead code in large re

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-25 13:06

    My approach is an intensive use of ESlint and make it run both on IDE ad before every push.

    It points out unused variables, methods, imports and so on. Webpack (which has too nice plugins for dead code detection) take care about avoiding to bundle unimported code.

提交回复
热议问题