-
-
Notifications
You must be signed in to change notification settings - Fork 43
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: Avoid dirname for built-in configs. #71
Conversation
Load eslint:recommended and eslint:all configs via import instead file paths. Fixes: eslint/eslint#15575
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should set filePath: ""
for clarity in logs. Otherwise, it would be filePath of the config where the extends
was.
Load eslint:recommended and eslint:all configs via import instead file paths. Fixes: eslint/eslint#15575
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I've verified that this works well both with eslint/eslint current main branch (which is important for backward compatibility), and with changes from eslint/eslint#15616.
|
||
if (extendName === "eslint:recommended") { | ||
const name = `${ctx.name} » ${extendName}`; | ||
|
||
if (getEslintRecommendedConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add in a check here to make sure getEslintRecommendedConfig is a function, and throw an error if not? I can picture this being difficult to debug if someone passes a nonfunction accidentally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
}); | ||
} | ||
if (extendName === "eslint:all") { | ||
const name = `${ctx.name} » ${extendName}`; | ||
|
||
if (getEslintAllConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for getEslintAllConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Load eslint:recommended and eslint:all configs via import instead file paths. Fixes: eslint/eslint#15575
Load eslint:recommended and eslint:all configs via import instead file paths. Fixes: eslint/eslint#15575
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Thanks for the approvals! May I have write access to the repository to merge the changes? |
|
@daidodo thanks for addressing all reviews, we'll merge the changes. @nzakas what do you think about these steps:
|
That sounds like a solid plan to me. 👍 |
All checks on eslint/eslint#15641 and eslint/eslint#15643 are passing (Step 1), so I'm merging this now (Step 2). Steps 3-6 will be later today. |
All steps are done. These changes are released in ESLint v8.10.0 & @eslint/eslintrc v1.2.0 |
Load eslint:recommended and eslint:all configs via import instead file paths.
Fixes: eslint/eslint#15575