tree-shakers are good at finding unused code in a module, but they can allow you to have a whole unused file somewhere in your project.
This script follows the require graph, and compares it to the
ls output, to find any files that are potentially not being used.
npm install -g unrequired
or from a node script:
There are probably some caveats to this.
It atleast attempts to support
.mjs files, and some other things.
it won't catch any unrequired
It uses rollup ⭐️