美文网首页
Vue+eslint+vsCode 配置

Vue+eslint+vsCode 配置

作者: 我爱萝卜花 | 来源:发表于2019-02-13 11:13 被阅读0次

1.vscode 安装插件

2.vue-cli初始化一个新项目

执行命令 vue init webpack +项目名称 (ESLint 一定要记得开。。。,项目中一定要有.eslintrc.js 文件,不然ESLint无法校验,

很久之前的项目忘记了自己把ESLint关掉了,浪费了一下午的时间。。被自己蠢哭了!!!)

3.项目配置

    输出抛错

1.执行 npm install eslint-plugin-html -save-dev 命令

2.文件=>首选项=>设置=>用户设置 里配置

"files.autoSave":"off",

    "eslint.validate": [

      "javascript",

      "javascriptreact",

      "html",

      { "language": "vue", "autoFix": true }

    ],

    "eslint.options": {

        "plugins": ["html"]

    },

    "vetur.validation.template": false,

3.运行项目 npm run dev

eslint 校验就可以了

相关文章

网友评论

      本文标题:Vue+eslint+vsCode 配置

      本文链接:https://www.haomeiwen.com/subject/gsmreqtx.html