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: don't crash when ESLint is not loaded #267

Merged
merged 1 commit into from Apr 22, 2024

Conversation

BenoitZugmeyer
Copy link
Owner

Before ESLint 9, the plugin needed to be imported only when actually linting files. Tools inspecting the configuration didn't need to import the plugin, as the configuration was declared as a plain JSON.

With ESLint 9, tools inspecting the configuration actually need to evaluate the configuration file wich imports the plugin. So it has a higher chance to be evaluated outside of ESLint.

To allow such use case, don't throw an exception when the plugin is not loaded through ESLint, but rather display a warning. The bug report template should be enough to gather the needed information.

Fixes #264

Before ESLint 9, the plugin needed to be imported only when actually
linting files. Tools inspecting the configuration didn't need to
import the plugin, as the configuration was declared as a plain JSON.

With ESLint 9, tools inspecting the configuration actually need to
evaluate the configuration file wich imports the plugin. So it has a
higher chance to be evaluated outside of ESLint.

To allow such use case, don't throw an exception when the plugin is not
loaded through ESLint, but rather display a warning. The bug report
template should be enough to gather the needed information.

Fixes #264
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review April 22, 2024 15:12
@BenoitZugmeyer BenoitZugmeyer merged commit 47cd6ba into main Apr 22, 2024
12 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the dont-crash-when-no-eslint branch April 22, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing the plugin in a flat config breaks @eslint/config-inspector
1 participant