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

fix: Use original plugin from disk in FlatCompat #137

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Nov 22, 2023

This switches FlatCompat to use the original (unnormalized) version of the plugin that was loaded from disk rather than the normalized version. This ensures that we'll avoid plugin redefinition errors when folks are using both FlatCompat and their own imports.

Fixes #135

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Nov 22, 2023
@nzakas
Copy link
Member Author

nzakas commented Nov 22, 2023

Looks like there's currently a problem with the GitHub CI services as it can't download Node.js. Will try re-running jobs in a bit.

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.

CI works now. Looks good, aside from one detail.

tests/lib/config-array/config-dependency.js Outdated Show resolved Hide resolved
tests/lib/config-array/config-dependency.js Outdated Show resolved Hide resolved
Comment on lines +112 to +113
definition: _ignore1, // eslint-disable-line no-unused-vars
original: _ignore2, // eslint-disable-line no-unused-vars
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Seems like https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern could be useful here, and then you can do something like

Suggested change
definition: _ignore1, // eslint-disable-line no-unused-vars
original: _ignore2, // eslint-disable-line no-unused-vars
definition: _,
original: __,

Copy link
Member

Choose a reason for hiding this comment

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

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!

@mdjermanovic mdjermanovic merged commit 1c4cf6a into main Nov 27, 2023
15 checks passed
@mdjermanovic mdjermanovic deleted the issue135 branch November 27, 2023 20:01
@github-actions github-actions bot mentioned this pull request Nov 27, 2023
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.

TypeError: Cannot redefine plugin
3 participants