Skip to content
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

feat: first approach to find existing eslint config #724

Closed

Conversation

KingDarBoja
Copy link
Collaborator

PR Checklist

Overview

globAsync: GlobAsync;
};

export const findExistingESLintConfiguration = async (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, yeah, the return type of this is what I was curious about... At first, I was thinking thinking the calling code will want to know whether this is an npm package style file or an ESLint one. For example, what happens if someone does something like --config ./packages/somewhere/package.json, and wants this to work on the eslintConfig in that nested file?

But, it's really only package.json files that have the odd eslintConfig member... Maybe the writing code would always want to override an existing eslintConfig in the output file if that output file's name ends with "package.json"? What do you think

status: ResultStatus.Failed,
};
}
if (globResult instanceof Error && typeof packageContent === "string") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, just marking this down because it confused me at first 😛

Suggested change
if (globResult instanceof Error && typeof packageContent === "string") {
if (typeof packageContent === "string") {

@JoshuaKGoldberg
Copy link
Member

Closing to keep the PR queue small. fyi @KingDarBoja 👍 thanks for the work on mapping out a first approach!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-detect original ESLint file in any form
2 participants