charlierudolph / dependency-lint

Lints NPM dependencies and devDependencies
MIT License
14 stars 6 forks source link

plugin support #38

Open charlierudolph opened 7 years ago

charlierudolph commented 7 years ago

In order to reduce the number of modules that end up ignoreErrors - unused, I think it would be interesting to try allowing plugins.

A plugin could be something that exports a function that returns a promise which resolves to the an array of the modules it determines are used. The function will be passed in the file path to the project and can search through whatever files it would like

An examples: webpack - read the config file, look through the loaders list and determine the name of the modules that webpack is requiring

Most of these would hopefully be very small functions. @kevgo @alexdavid thoughts?

kevgo commented 7 years ago

I love the idea. Since we know this is for Node only, we could install the plugins as devDependencies and mention them in a section of dependency.yml.

charlierudolph commented 7 years ago

Just recording an idea @alexdavid had which is allowing plugins to also do extra parsing of what what modules are actually used in a single require call. An example of this is webpack loaders which would replace the current option to strip loaders

vvscode commented 9 months ago

is repo still alive? I wonder as I don't want to invent the wheel, and this one looks interesting, but I don't see many recent updates (including the topic about plugins)