You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
ESLint config is broken due to used dependency versions of eslint and eslint-plugin-html.
gulp lint does seem to work though. So I guess gulp-eslint is working fine, but directly calling the eslint CLI doesn't currently work in combination with eslint-plugin-html (when linting HTML files) which also breaks IDE integrations (like ESLint extension for VS Code [dbaeumer.vscode-eslint]) which depend on the eslint CLI.
When opening an HTML file with VS Code, the ES Lint extension throws an error (see "Actual outcome" below)
Expected outcome
ES Lint plugin in VS Code should work fine when you open HTML files in the project. Also calling ./node_modules/eslint/bin/eslint.js src/**/*.html should work without errors.
Actual outcome
In both use cases an error is thrown:
TypeError: Cannot read property 'define' of undefined
at Linter.verifyWithSharedScopes (/Users/haprog/Work/components/vaadin-combo-box/node_modules/eslint-plugin-html/src/index.js:202:16)
at Linter.verify (/Users/haprog/Work/components/vaadin-combo-box/node_modules/eslint-plugin-html/src/index.js:170:32)
at Linter.verifyAndFix (/Users/haprog/Work/components/vaadin-combo-box/node_modules/eslint/lib/linter.js:1035:29)
at processText (/Users/haprog/Work/components/vaadin-combo-box/node_modules/eslint/lib/cli-engine.js:197:32)
at CLIEngine.executeOnText (/Users/haprog/Work/components/vaadin-combo-box/node_modules/eslint/lib/cli-engine.js:690:40)
at /Users/haprog/.vscode/extensions/dbaeumer.vscode-eslint-1.8.2/server/out/eslintServer.js:1:35002
at W.E.get.N.then.n (/Users/haprog/.vscode/extensions/dbaeumer.vscode-eslint-1.8.2/server/out/eslintServer.js:1:35937)
Steps to reproduce
Either make a fresh clone of a component repo (e.g. vaadin-combo-box) or delete node_modules/ directory
Run npm install
Do one of
a. Run ./node_modules/eslint/bin/eslint.js src/**/*.html
b. use VS Code to open an HTML file which includes some JS. (e.g. src/vaadin-combo-box.html in vaadin-combo-box)
Can be fixed by either downgrading eslint to version 5.12.0 (now the dependency is ^5.0.0 which currently resolves to 5.15.1) or by upgrading eslint-plugin-html to 5.0.1 or later (now the dependency is ^4.0.0 which currently resolves to 4.0.5).
Description
ESLint config is broken due to used dependency versions of
eslint
andeslint-plugin-html
.gulp lint
does seem to work though. So I guessgulp-eslint
is working fine, but directly calling theeslint
CLI doesn't currently work in combination witheslint-plugin-html
(when linting HTML files) which also breaks IDE integrations (like ESLint extension for VS Code [dbaeumer.vscode-eslint]) which depend on theeslint
CLI.When opening an HTML file with VS Code, the ES Lint extension throws an error (see "Actual outcome" below)
Expected outcome
ES Lint plugin in VS Code should work fine when you open HTML files in the project. Also calling
./node_modules/eslint/bin/eslint.js src/**/*.html
should work without errors.Actual outcome
In both use cases an error is thrown:
Steps to reproduce
vaadin-combo-box
) or deletenode_modules/
directorynpm install
a. Run
./node_modules/eslint/bin/eslint.js src/**/*.html
b. use VS Code to open an HTML file which includes some JS. (e.g.
src/vaadin-combo-box.html
invaadin-combo-box
)Cause
This problem seems to be caused by BenoitZugmeyer/eslint-plugin-html#113.
See also: eslint/eslint#11346
Can be fixed by either downgrading
eslint
to version5.12.0
(now the dependency is^5.0.0
which currently resolves to5.15.1
) or by upgradingeslint-plugin-html
to5.0.1
or later (now the dependency is^4.0.0
which currently resolves to4.0.5
).Looks like this would be fixed by #3.
Workaround
This can be locally worked around (per clone) by doing one of these (and then reloading VS Code):
npm i -D eslint-plugin-html@^5.0.0
npm i -D eslint@5.12.0
The text was updated successfully, but these errors were encountered: