From 47cd6bac127a8431e4447c58d359d0f09038423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Mon, 22 Apr 2024 16:59:16 +0200 Subject: [PATCH] fix: don't crash when ESLint is not loaded 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 https://github.com/BenoitZugmeyer/eslint-plugin-html/issues/264 --- .github/ISSUE_TEMPLATE/bug-report.md | 2 +- src/index.js | 36 ++-------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index f4e7f30..c9d558b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -15,7 +15,7 @@ Describe the issue precisely: what are you trying to do? what's the expected res - eslint-plugin-html version: - NodeJS version: - Operating System name and version: -- ESLint configuration (.eslintrc): +- ESLint configuration (.eslintrc/eslint.config.js):