vue cli4 拿到一个项目后

1,拿到一个项目,里面没有node_modules

得先cmd 到这个目录下面,cnpm install 安装依赖

安装后,npm run serve

发现报错,少了eslint

在page.json配置下,添加

  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  }

再运行,发现有 eslint格式bug,

没办法,新建个项目根目录,新建个文件名 .eslintignore,

输入以下:

**/*.js
**/*.vue
// eslint-disable-next-line to ignore the next line.
console.log("这行esline不检查")
/* eslint-disable */
console.log("整个文件都忽略eslint检查")

再运行 npm run serve,可以了

猜你喜欢

转载自www.cnblogs.com/keta/p/12916184.html
今日推荐