eslint
HTML file error after introducing prettier
: parsing error: unexpected token (prettier/prettier)
Cause of problem
The parser
of prettier
is not configured correctly. (I don’t know why it needs to be configured separately. It should have default configuration for all corresponding file types)
Solution
Modify .prettierrc.json
, add overides
, and configure the parser of HTML. Configurable item: Reference
{
"printWidth": 120,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"htmlWhitespaceSensitivity": "ignore",
"overrides": [
{
"files": "*.html",
"options": {
"parser": "html"
}
}
]
}
Read More:
- [Solved] Vue prettier error: error Delete `␍` prettier/prettier
- [Solved] Vue3 Error: error Delete `··` prettier/prettier
- [Solved] vue Project Error: react lazy eslint error Parsing error: Unexpected token import
- [Solved] Failed to load config “prettier“ to extend from.?
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- [Solved] Eslint Error: Parsing error: x-invalid-end-tag
- [Solved] Uncaught SyntaxError: Unexpected token ‘<‘
- [Solved] Vue unit test syntax error: unexpected token ‘export‘
- [Solved] Webpack compile error: SyntaxError: Unexpected token =
- Vue Import three.JS error: Unexpected token [How to Solve]
- ArcGIS API for JavaScript version 4. X updated and the project startup error: Module parse failed: Unexpected token(… …
- [Solved] Syntax Error: Error: No ESLint configuration found & TypeError: eslint.CLIEngine is not a constructor
- [Solved] React Startup Error at the First time :SyntaxError: Unexpected token
- [Solved] Error in created hook: “SyntaxError: Unexpected token o in JSON at position 1“
- Error in created hook: “SyntaxError: Unexpected token u in JSON at position 0
- [Solved] Vue-vscode Error: Parsing error: Unexpected reserved word ‘await‘.
- Vscode save Vue format eslint check error [How to Solve]
- When using iView, report: no parsing error parsing error: x-invalid-end-tag solution
- [Solved] Vue eslint Error: Component name “*****“ should always be multi-word
- eslint Error: Delete `␍` [How to Solve]