vscode配置setting.json文件eslint自动修复时报错:
The setting is deprecated. Use editor.codeActionsOnSave instead with a source
解决方案:
{
// vscode默认启用了根据文件类型自动设置tabsize的选项
"editor.detectIndentation": false,
// 重新设定tabsize
"editor.tabSize": 2,
// 每次保存的时候自动格式化
"editor.formatOnSave": true,
// 启用保存时自动修复eslint,默认只支持.js文件
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
// 添加vue支持
"eslint.validate": [
"javascript",
"javascriptreact",
"vue"
],
// 让prettier使用eslint的代码格式进行校验
"prettier.eslintIntegration": true,
"editor.fontLigatures": false,
"[javascript]": {
"editor.formatOnSave": false
},
}