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 286
// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Implementing

Development

Successfully merging this pull request may close these issues.

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

2 participants