Skip to content

Conversation

@aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Oct 6, 2025

Prerequisites checklist

What is the purpose of this pull request?

What changes did you make? (Give an overview)

The plugin configuration lookup logic has been refactored to better accommodate scenarios where the eslintrc does not exist.

Related Issues

fixes #290.
refs: eslint/generator-eslint#227

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Oct 6, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Oct 6, 2025
@aladdin-add aladdin-add force-pushed the fix/flat-config-fallback branch from 3f6f106 to 252109a Compare October 6, 2025 17:33
@aladdin-add aladdin-add moved this from Needs Triage to Implementing in Triage Oct 6, 2025
@aladdin-add aladdin-add requested a review from nzakas October 6, 2025 17:34
@nzakas
Copy link
Member

nzakas commented Oct 6, 2025

Please update the description of this PR with a description of the problem this is meant to fix, just like you would with a bug report.

@aladdin-add
Copy link
Member Author

filed the issue in #290.


throw new TypeError(
`Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`,
// If it's a legacy config, or the config does not exsist => look for the flat version
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// If it's a legacy config, or the config does not exsist => look for the flat version
// If it's a legacy config, or the config does not exist => look for the flat version

Comment on lines 282 to 292
// If we get here, then the config was either not found or is a legacy config
const message = directConfig
? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
throw new TypeError(message);
Copy link
Member

Choose a reason for hiding this comment

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

This logic doesn't seem correct to me. There could be a flatConfig that is an eslintrc, but it looks like this logic will say the config wasn't found.

Copy link
Member Author

Choose a reason for hiding this comment

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

right! should be addressed in 71e013b.

@aladdin-add aladdin-add force-pushed the fix/flat-config-fallback branch from 71e013b to e9c4a45 Compare October 11, 2025 05:18
@aladdin-add aladdin-add self-assigned this Oct 11, 2025
@aladdin-add aladdin-add requested a review from nzakas October 11, 2025 05:18
@mdjermanovic
Copy link
Member

Going to close-reopen to run CI tests with da3838f included.

@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Oct 12, 2025
@mdjermanovic mdjermanovic reopened this Oct 12, 2025
@github-project-automation github-project-automation bot moved this from Complete to Evaluating in Triage Oct 12, 2025
@mdjermanovic mdjermanovic moved this from Evaluating to Implementing in Triage Oct 12, 2025
@aladdin-add aladdin-add force-pushed the fix/flat-config-fallback branch from e9c4a45 to 87a2e09 Compare October 12, 2025 15:27
@aladdin-add aladdin-add force-pushed the fix/flat-config-fallback branch from 87a2e09 to fb0344c Compare October 12, 2025 15:30
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Leaving open for @nzakas to verify.

@mdjermanovic mdjermanovic moved this from Implementing to Second Review Needed in Triage Oct 16, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@nzakas nzakas merged commit ddc8577 into main Oct 17, 2025
21 checks passed
@nzakas nzakas deleted the fix/flat-config-fallback branch October 17, 2025 13:55
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Oct 17, 2025
@github-actions github-actions bot mentioned this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted bug Something isn't working

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Bug: TypeError: Plugin config "recommended" not found in plugin "plugin-x".

4 participants