esplint icon indicating copy to clipboard operation
esplint copied to clipboard

Add an option to specify configuration file(s)

Open spikyjt opened this issue 3 years ago • 3 comments

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.

spikyjt avatar Dec 15 '21 09:12 spikyjt

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.

hjylewis avatar Dec 15 '21 16:12 hjylewis

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.

spikyjt avatar Dec 15 '21 16:12 spikyjt

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.

hjylewis avatar Dec 15 '21 16:12 hjylewis