Bug: env
Key Misformatted in Flat Config When Using Standard Recommended Settings
#2546
Labels
env
Key Misformatted in Flat Config When Using Standard Recommended Settings
#2546
1️⃣ Explain here what's wrong
When configuring ESLint with the Unicorn plugin, using the standard recommended settings introduces an improperly formatted
env
key in the configuration. This key appears to follow the traditional.eslintrc
format instead of the expected flat config format. Consequently, ESLint throws an error stating:This issue does not occur when using the flat recommended settings, which behave as intended.
2️⃣ Specify which rule is buggy here and in the title
The bug arises when using the standard
eslint-plugin-unicorn
recommended configuration. Specifically, the issue is with how the recommended settings handle theenv
key in the context of ESLint's flat config.3️⃣ Add some examples where the issue appears
Example Configuration Causing the Issue:
Error Message:
Working Configuration Using Flat Recommended Settings:
Uncommenting the flat recommended settings resolves the issue:
and using
eslintPluginUnicorn.configs["flat/recommended"]
fixes it.Additional Information
Steps to Reproduce
eslint-plugin-unicorn
using the standardrecommended
settings.env
key format.Expected Behavior
Using the standard
eslint-plugin-unicorn
recommended settings should correctly apply configurations in the flat config format without introducing improperly formatted keys.Actual Behavior
Applying the standard
eslint-plugin-unicorn
recommended settings introduces anenv
key in the traditional.eslintrc
format, causing ESLint to throw a configuration error.Possible Solution
Use whatever is exported via
eslintPluginUnicorn.configs["flat/recommended"],
because that works.The text was updated successfully, but these errors were encountered: