Open ghost opened 5 years ago
depcheck
has some magic inside that ends up generating a list of packages used. That may help.
But do note that knowing what packages are used is not enough, as not all files in a package are used when a module is imported. There has to be at least some parsing of their respective package.json
to figure out the actual files to lint.
The fact that modules can be dynamically imported makes things even harder to deal with, as evidenced by "smart" code that chooses between a transpiled ES5 version and the original by some feature test with try/catch on a new Function(). Well, maybe we should just follow AMD and refuse to pick one on those.
Requested Update
It would be handy if
es-check
could also check all required/imported files as well. I tried to runes-check es5 ./dist/index.js
and it said it was no matching errors, but when I included my module in a react-app in complained that one of my dependencies was not in ES5.Why Is This Update Needed?
To make sure the entire module and not a single file is in ES5.
Are There Examples Of This Requested Update Elsewhere?