Vscode eslint代码自动修复格式化

817 阅读1分钟

vscode eslint规则格式自动修复

1.打开vscode扩展设置项( 文件 -- 首选项 -- 设置 )

"eslint.autoFixOnSave": true, //为true保存时自动修复,默认只支持.js文件
"editor.codeActionsOnSave": {
    "source.fixAll.eslint": true, // 用eslint规则对html进行校验
    "source.fixAll.stylelint": true // 用stylelint规则对html进行校验
 }