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: exported / referenced plugin same instance #380

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

voxpelli
Copy link
Member

@voxpelli voxpelli commented Nov 7, 2024

It's important that the exported plugin reference and the one used in the exported configs are the very same – else one will get an error like:

ConfigError: Config "node/flat/recommended-module": Key "plugins": Cannot redefine plugin "n".

This since two plugins are only allowed to have the same key if they are === to one another. See: https://github.com/eslint/eslint/blob/0583c87c720afe0b9aef5367b1a0a77923eefe9d/lib/config/flat-config-schema.js#L373-L375

This caused a regression for me in https://github.com/voxpelli/eslint-config/blob/638bbad2580bc4246527a6f0d989dc8194547475/base-configs/node.js#L10

@voxpelli voxpelli added the bug label Nov 7, 2024
@voxpelli voxpelli requested review from scagood and a team November 7, 2024 11:49
Copy link

@scagood scagood left a comment

Choose a reason for hiding this comment

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

🤔 What a strange bug!

@scagood scagood merged commit 3c45b67 into master Nov 7, 2024
31 checks passed
@scagood scagood deleted the fix-plugin-reference branch November 7, 2024 12:06
@voxpelli
Copy link
Member Author

voxpelli commented Nov 7, 2024

🤔 What a strange bug!

Yeah, it’s a bit odd that flat configs allows a redeclaration of a plugin but only if that plugin is === to the existing one.

Creates odd expectations.

@voxpelli
Copy link
Member Author

voxpelli commented Nov 7, 2024

Had to do a workaround for it in neostandard: neostandard/neostandard@26b472b

And have still had people ask to add it plugins as peer dependencies instead again: neostandard/neostandard#184

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

Successfully merging this pull request may close these issues.

2 participants