-
Notifications
You must be signed in to change notification settings - Fork 51
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
Importing the plugin in a flat config breaks @eslint/config-inspector #264
Comments
BenoitZugmeyer
added a commit
that referenced
this issue
Apr 22, 2024
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 it declared as a plain JSON. With ESLint 9, tools inspecting the configuration actually need to import 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
added a commit
that referenced
this issue
Apr 22, 2024
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 it declared as a plain JSON. With ESLint 9, tools inspecting the configuration actually need to import 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
added a commit
that referenced
this issue
Apr 22, 2024
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
added a commit
that referenced
this issue
Apr 22, 2024
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
Thank you for the report, I'm releasing a fix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
While trying to upgrade a project's ESLint setup to v9 with flat configs, I noticed that loading
eslint-plugin-html
in a flat config prevents the usage of https://github.com/eslint/config-inspector when I tried debugging configuration issues during the migration. Specifically, the inspector always crashes on startup due toError: eslint-plugin-html error: It seems that eslint is not loaded.
So I'm forced to either comment out the plugin whenever I want to use the inspector, or remove the plugin from the flat config to avoid the issue entirely.
Setup configuration
9.0.0
eslint-plugin-html
version:8.1.0
21.7.3
Ubuntu 22.04.4 LTS
eslint.config.js
):N/A
N/A
Additional context
Here's a repository that provides a minimal reproduction of the issue: https://github.com/bryan-hoang/repro-eslint-html-config-inspector
An example of the error & full stack trace
The text was updated successfully, but these errors were encountered: