the background
I have tried to get eslint-plugin-html working, but I just keep getting errors.
As you can see I am using the latest version of ESLint which uses the la Config with extends.
I used htmlscripts instead of html when defining this plugin because I already have added eslint-html as html. perhaps the demo code should use a different keyword if what I have done is correct.
the question
Please can someone tell me what mistakes I have made or if the current version is not compatible with my setup.
The error shown in VSCode
Could not find a declaration file for module 'eslint-plugin-html'. 'c:/Users/shoulders/Desktop/thetemp/node_modules/eslint-plugin-html/src/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/eslint-plugin-html if it exists or add a new declaration (.d.ts) file containing declare module 'eslint-plugin-html';ts(7016)

the terminal error - when i load a .html file
[Error - 3:21:48 PM] An unexpected error occurred:
[Error - 3:21:48 PM] TypeError: context.getScope is not a function
Occurred while linting C:\Users\shoulders\Desktop\thetemp\index.html:1
Rule: "__eslint-plugin-html-prepare/__eslint-plugin-html-prepare"
at getGlobalScope (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint-plugin-html\src\verifyWithSharedScopes.js:80:18)
at prepare (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint-plugin-html\src\verifyWithSharedScopes.js:12:29)
at Program (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint-plugin-html\src\verifyWithFlatConfigPatch.js:70:21)
at ruleErrorHandler (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint\lib\linter\linter.js:1307:33)
at C:\Users\shoulders\Desktop\thetemp\node_modules\eslint\lib\linter\safe-emitter.js:45:46
at Array.forEach (<anonymous>)
at Object.emit (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint\lib\linter\safe-emitter.js:45:26)
at #applySelector (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint\lib\linter\source-code-traverser.js:148:17)
at ESQueryHelper.applySelectors (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint\lib\linter\source-code-traverser.js:206:24)
at SourceCodeTraverser.traverseSync (C:\Users\shoulders\Desktop\thetemp\node_modules\eslint\lib\linter\source-code-traverser.js:277:16)
My Environment
VSCode: v 1.101.0
ESLint: v9.28.0
node: v22.16.0
npm ls
├── @eslint/css@0.8.1
├── @eslint/js@9.28.0
├── @eslint/json@0.12.0
├── @eslint/markdown@6.5.0
├── @html-eslint/eslint-plugin@0.41.0
├── @html-eslint/parser@0.41.0
├── eslint-plugin-html@8.1.3
├── eslint@9.28.0
├── globals@16.2.0
└── help@3.0.2
My eslint.config.mjs
import js from "@eslint/js";
import globals from "globals";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import css from "@eslint/css";
import html from "@html-eslint/eslint-plugin";
import htmlscripts from "eslint-plugin-html";
import { defineConfig } from "eslint/config";
export default defineConfig([
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } },
{ files: ["**/*.json"], plugins: { json }, language: "json/json", extends: ["json/recommended"] },
{ files: ["**/*.jsonc"], plugins: { json }, language: "json/jsonc", extends: ["json/recommended"] },
{ files: ["**/*.json5"], plugins: { json }, language: "json/json5", extends: ["json/recommended"] },
{ files: ["**/*.md"], plugins: { markdown }, language: "markdown/gfm", extends: ["markdown/recommended"] },
{ files: ["**/*.css"], plugins: { css }, language: "css/css", extends: ["css/recommended"] },
{ files: ["**/*.html"], plugins: { html }, language: "html/html", extends: [html.configs["flat/recommended"]] },
{ files: ["**/*.html"], plugins: { htmlscripts } },
]);
the background
I have tried to get
eslint-plugin-htmlworking, but I just keep getting errors.As you can see I am using the latest version of ESLint which uses the la Config with extends.
I used
htmlscriptsinstead ofhtmlwhen defining this plugin because I already have addedeslint-htmlashtml. perhaps the demo code should use a different keyword if what I have done is correct.the question
Please can someone tell me what mistakes I have made or if the current version is not compatible with my setup.
The error shown in VSCode
the terminal error - when i load a .html file
My Environment
VSCode: v 1.101.0
ESLint: v9.28.0
node: v22.16.0npm ls├── @eslint/css@0.8.1
├── @eslint/js@9.28.0
├── @eslint/json@0.12.0
├── @eslint/markdown@6.5.0
├── @html-eslint/eslint-plugin@0.41.0
├── @html-eslint/parser@0.41.0
├── eslint-plugin-html@8.1.3
├── eslint@9.28.0
├── globals@16.2.0
└── help@3.0.2
My eslint.config.mjs