前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Vue express项目npm run dev报错:ESlint Missing的解决方法

Vue express项目npm run dev报错:ESlint Missing的解决方法

作者头像
德顺
发布2020-03-17 11:54:03
2.3K0
发布2020-03-17 11:54:03
举报
文章被收录于专栏:前端资源

今天用 Vue 脚手架 Vue CLI 拉了一个 express 项目, npm run dev 运行时报错:

详细报错内容如下:

代码语言:javascript
复制
 WARNING  Compiled with 3 warnings                                                                                                                                                                                                                               22:30:22

  ✘  http://eslint.org/docs/rules/comma-dangle  Unexpected trailing comma
  src\components\HelloWorld.vue:92:15
        data: [],
                 ^
✘ 1 problem (1 error, 0 warnings)

Errors:
  1  http://eslint.org/docs/rules/comma-dangle

  ✘  http://eslint.org/docs/rules/space-before-function-paren  Missing space before function parentheses
  src\App.vue:11:10
    mounted(){
            ^
  ✘  http://eslint.org/docs/rules/space-before-blocks          Missing space before opening brace
  src\App.vue:11:12
    mounted(){
              ^
  ✘  http://eslint.org/docs/rules/quotes                       Strings must use singlequote
  src\App.vue:12:20
      this.axios.get("api/list").then((res)=>{
                      ^
  ✘  http://eslint.org/docs/rules/arrow-spacing                Missing space before =>
  src\App.vue:12:41
      this.axios.get("api/list").then((res)=>{
                                           ^
  ✘  http://eslint.org/docs/rules/arrow-spacing                Missing space after =>
  src\App.vue:12:44
      this.axios.get("api/list").then((res)=>{
                                              ^
  ✘  http://eslint.org/docs/rules/semi                         Extra semicolon
  src\App.vue:13:23
        console.log(res);
                         ^
✘ 6 problems (6 errors, 0 warnings)

Errors:
  2  http://eslint.org/docs/rules/arrow-spacing
  1  http://eslint.org/docs/rules/space-before-function-paren
  1  http://eslint.org/docs/rules/space-before-blocks
  1  http://eslint.org/docs/rules/quotes
  1  http://eslint.org/docs/rules/semi

  ✘  https://google.com/#q=import%2Ffirst  Import in body of module; reorder to top
  src\main.js:9:1
  import axios from 'axios';
   ^
  ✘  http://eslint.org/docs/rules/semi     Extra semicolon
  src\main.js:9:26
  import axios from 'axios';
                            ^
  ✘  http://eslint.org/docs/rules/semi     Extra semicolon
  src\main.js:10:28
  Vue.prototype.axios = axios;
                              ^
✘ 3 problems (3 errors, 0 warnings)

Errors:
  2  http://eslint.org/docs/rules/semi
  1  https://google.com/#q=import%2Ffirst

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

解决方法:

找到项目 config 文件夹下的 index.js 文件,将 useEslint 的值修改为 false 即可:

声明:本文由w3h5原创,转载请注明出处:《Vue express项目npm run dev报错:ESlint Missing的解决方法》 https://cloud.tencent.com/developer/article/1599487

本文已加入 腾讯云自媒体分享计划 (点击加入)

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 解决方法:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档