项目中配置下载了eslint各种配置,vscode配置文件settings.json中配置了,但是就是代码没有标红,不能自动修复。
最终发现问题所在
在vscode的配置文件settings.json中
eslint.options 有个这个参数,如果没有注释就注释掉,有的话就放开,进行一个切换就可以了
这是我整个settings.json里的配置
{
"beautify.config": "",
//beautify 格式化配置
"[javascript]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"[json]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"eslint.nodeEnv": "",
"editor.tabSize": 2,
//配置 eslint
// "eslint.options": {
// "plugins": [
// "html"
// ]
// },
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"open-in-browser.default": "{\"open-in-browser.default\":\"Chrome\"}",
"editor.quickSuggestions": {
"strings": true
},
"eslint.workingDirectories": [
],
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"files.autoSave": "afterDelay",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.unicodeHighlight.ambiguousCharacters": false,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.startupEditor": "none",
"workbench.editorAssociations": {
"*.html": "default"
},
"editor.unicodeHighlight.invisibleCharacters": false,
"diffEditor.ignoreTrimWhitespace": false,
"merge-conflict.autoNavigateNextConflict.enabled": true,
"eslint.format.enable": true,
"eslint.lintTask.enable": true,
"eslint.quiet": true
}
标签:vscode,defaultFormatter,beautify,报错,eslint,true,editor
From: https://www.cnblogs.com/wang--chao/p/17282312.html