-
Notifications
You must be signed in to change notification settings - Fork 101
Use ESLint's existing config lookup system to look up ESLint config #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In retrospect, this seems lower priority. Folks can manually pass their ESLint file path. The investigation in #232 is a cool one but let's hold off on accepting PRs till a solution that doesn't involve |
@JoshuaKGoldberg here's what I found while looking into #232. It turns out the argument passed to Since we only care about the root ESLint config file, we can pass in a file that should exist in the root folder of every project and ESLint will resolve the config file path by itself: eslint --print-config package-lock.json And if we want to specify a custom config file: eslint --print-config package-lock.json --config <eslintrc file> Finally, here is a possible method to get the reported configuration using ESLint's API import { CLIEngine } from "eslint";
...
return new CLIEngine({}).getConfigForFile("package-lock.json"); Edit: unfortunately this won't work when generating the raw configuration |
Yeah, I poked around here and couldn't find a good way to extract the internal ESLint logic within the config factory. The point of this issue was that it would be good to detect any of the support ESLint configuration names; I'll file a separate issue to do specifically that manually. |
🚀 Feature Request
Right now, if you don't specify an
--eslint
to an ESLint configuration file, only.eslintrc.js
will be looked at. ESLint allows other formats such as JSON and YAML.Existing Behavior
The path to look up an existing ESLint configuration file is hardcoded to
.eslintrc.js
.Change Proposal
Use whatever ESLint does (or, if that's not easily doable, some similar semblance) to look up that file path.
Related: #10
The text was updated successfully, but these errors were encountered: