hjylewis / esplint

:face_with_head_bandage: An ESLint warning tracker to help introduce rules into a legacy code base
MIT License
38 stars 9 forks source link

Add an option to specify configuration file(s) #115

Open spikyjt opened 2 years ago

spikyjt commented 2 years ago

When I run esplint through lint-staged with husky, I get an error No config file found. We have a multi-package monorepo.

If we could specify the path to the esplint config file and the eslint config file, if necessary, then I think we could solve this.

hjylewis commented 2 years ago

Good idea!

Full transparency, I don't have a lot of time for this project.

Feel free to take a stab at this and open a PR. I don't think it will be too complex of a change. Otherwise, I'll get to it when I get to it.

This package uses cosmiconfig under the hood. https://github.com/davidtheclark/cosmiconfig. Looks like we'd just need to add a flag and call explorer.load(pathToConfig) when that flag is used.

spikyjt commented 2 years ago

So I discovered that this does actually work in a monorepo, we just have an extra complex setup, which currently has nested sub-packages (only temporary!)

Still it would be good to have a config file option.

I may get some time to contribute, but right now we are postponing implementing this package, as it takes longer to run than the linter. It would be ideal if it could run as part of eslint, rather than having to re-analyse.

hjylewis commented 2 years ago

I may get some time to contribute, but right now we are postponing implementing this package, as it takes longer to run than the linter. It would be ideal if it could run as part of eslint, rather than having to re-analyse.

Agreed. Technically you can run esplint instead of eslint since esplint runs eslint under the hood.