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:
- Vscode save Vue format eslint check error [How to Solve]
- [Vue Run Error] Module build failed: Error: Couldn‘t resolve parser “babylon“
- [Solved] Prittier format code error: JSON Error in…
- [Solved] Vue prettier error: error Delete `␍` prettier/prettier
- [Solved] Failed to load config “prettier“ to extend from.?
- eslint Error: Delete `␍` [How to Solve]
- How to Solve VUE Error: Mixed spaces and tabs
- [Solved] Errors: 1 http://eslint.org/docs/rules/quotes…elementUI Import Error
- [Solved] Vue2.0 Error: Syntax Error: TypeError: eslint.CLIEngine is not a constructor
- How to Solve Vscode save Vue file eslint error
- [Solved] Syntax Error: Error: No ESLint configuration found & TypeError: eslint.CLIEngine is not a constructor
- [Solved] Vue Project startup error: no eslint configuration found
- [Solved] VUE eslint Error: Expected linebreaks to be ‘LF‘ but found ‘CRLF
- [Solved] Vue3.0 Error: The component has been registered but not used vue/no-unused-components, Close eslint
- [Solved] Vue 3 Script Setup ESLint Error: ‘defineProps‘ is not defined
- [Solved] error: Unexpected console statement (no-console)
- The body of a for-in should be wrapped in an if statement to filter unwanted properties from the pro
- [Solved] Failed to load plugin ‘vue‘ declared in ‘.eslintrc.js‘: createRequire is not a function
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- [Solved] Vue Project Error: Arrow function should not return assignment