Automatic detection of preconfigured eslint packages
See original GitHub issueFeature Request: I would love to have automatic detection of the most common “packaged eslint” flavors, specifically standard and xo.
I often contribute to many packages which uses both Standard and XO. My current setup is just to have the StandardJS package installed in VS Code, since that is what I use for my own projects. But that makes basically every line being marked red when contributing to a package using the XO eslint package.
My idea of the ultimate setup would be if this module could detect whenever one of the preconfigured eslint packages is being used in a project, and then load up that config.
In practice, I think this would be easiest to achieve by maintaining a list of packages to look for in the devDependencies
, and a corresponding eslint-config for that package.
const eslintPackages = new Map([
['happiness', 'eslint-config-happiness'],
['semistandard', 'eslint-config-semistandard'],
['standard', 'eslint-config-standard'],
['xo', 'eslint-config-xo']
])
If this is something that is wanted, I would be happy to help implement it. If you think that this is out of scope for this module, I would totally understand that.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thanks for the nice explanation. I wasn’t aware of
eslint -c standard
. The ESLint extension however doesn’t spawn an eslint process on every linting run. It basically uses eslint as a library and programs against the Node API provided (https://eslint.org/docs/developer-guide/nodejs-api#cliengine). From reading through the documentation your approach should be doable using theconfigFile
option. To test this you could set `“eslint.options.configFile”: “standard” and see what happens.I am open to a PR that implements this be checking the content of the package.json file.
This feature request will not be considered in the next 6-12 months and has been closed to keep the number of issues we have to maintain manageable. See also our issue reporting guidelines.
Thanks for your understanding and happy coding!