Vue脚手架下启动Eslint静态检查

比较蠢...竟然不知道Vue脚手架如何启动静态检查,直到我发现了Package.json

  "scripts": {
    "dev": "node build/dev-server.js",
    "start": "node build/dev-server.js",
    "build": "node build/build.js",
    "lint": "eslint --ext .js,.vue src"
  }

所以执行npm run lint就开始执行静态检查啦~

xxx:my-mpvue xxx$ npm run lint

> [email protected] lint /Users/xxx/Desktop/Fluently_Project/my-mpvue
> eslint --ext .js,.vue src

/Users/xxx/Desktop/Fluently_Project/my-mpvue/src/App.vue
  7:23  error  Strings must use singlequote  quotes

✖ 1 problem (1 error, 0 warnings)
  1 error, 0 warnings potentially fixable with the `--fix` option.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint: `eslint --ext .js,.vue src`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/liuchang/.npm/_logs/2018-07-28T16_12_36_350Z-debug.log

你可能感兴趣的:(Vue脚手架下启动Eslint静态检查)