ESLint 配置保存 自动格式化代码 vscode

在.eslintrc.js 添加 vscode 终端启动服务

 

 2、在同级目录新建.prettierrc

{
  "printWidth": 120,
  "semi": false,
  "singleQuote": true,
  "prettier.spaceBeforeFunctionParen": true
}

3、打开VS code 文件》首选项》设置》扩展》ESLint》 请先安装ESLint扩展工具

 

 

    // eslint格式化字符串
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },

 

posted @ 2021-06-19 16:25  Jim-vue  阅读(545)  评论(0编辑  收藏  举报