Reputation: 309
why eslint give me this error Parsing error: Unexpected token < in html file? how can i solve this error? my .eslint.json configs:
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"airbnb-base"
],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"strict": "off"
}
}
Upvotes: 12
Views: 9849
Reputation: 1000
Adding the below to ".eslintrc.json" file worked for me:
"ignorePatterns": [
"**/*.html"
]
Upvotes: 6
Reputation: 25
One other option can be to add an .eslintignore
file. See the exmple below.
.eslintignore
.vscode/*
dist/*
assets/*
node_modules/*
**/index.html
**/index.*.html
**/assets/*.html
Upvotes: 0
Reputation: 585
you need eslint-plugin-html
to lint html file. the details can be found in this link: https://www.npmjs.com/package/eslint-plugin-html
Upvotes: 13