将eslint v3迁移至Vue项目上的v4

时间:2018-11-26 04:32:53

标签: vue.js npm eslint eslintrc

我想将项目的eslint v3迁移到v4。

我将eslint更改为v4,并在package.json上迁移eslint的插件。

版本:

操作系统:Windows10

Node.js:8.11.2

Vue.js:2.5.0

package.json中eslint和eslint插件的版本: "eslint": "^4.0.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^4.0.1", "eslint-loader": "^2.1.1", "eslint-plugin-html": "^5.0.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^3.1.0",

但是当做棉绒时,会发生如下错误:

棉绒命令:

eslint --ext .js,.vue src

错误:

> 1 | <!-- COMMENTCOMMENTCOMMENTCOMMENTCOMMENT -->
    | ^
  2 | <template>
  src\components\foo\FooBar.vue:1:1
  <!-- COMMENTCOMMENTCOMMENTCOMMENTCOMMENT -->
   ^

✘ 1 problem (1 error, 0 warnings)

Errors:
  1  http://eslint.org/docs/rules/null
    at emitError (C:\Users\yosuke\MyProject\node_modules\webpack\lib\NormalModule.js:123:22)
    at printLinterOutput (C:\Users\yosuke\MyProject\node_modules\eslint-loader\index.js:128:9)
    at Object.module.exports (C:\Users\yosuke\MyProject\node_modules\eslint-loader\index.js:248:3)
 @ ./node_modules/extract-text-webpack-plugin/dist/loader.js??ref--6-0!./node_modules/vue-style-loader!./node_modules/css-loader??ref--6-2!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib??vue-loader-options!./src/components/login/StressLogin.vue?vue&type=style&index=0&id=c950f03c&scoped=true&lang=css&
 @ ./src/components/foo/FooBar.vue?vue&type=style&index=0&id=c950f03c&scoped=true&lang=css&
 @ ./src/components/foo/FooBar.vue
 @ ./node_modules/babel-loader/lib??ref--2!./node_modules/vue-loader/lib??vue-loader-options!./src/components/top/TopManager.vue?vue&type=script&lang=js&
 @ ./src/components/top/TopManager.vue?vue&type=script&lang=js&
 @ ./src/components/top/TopManager.vue
 @ ./node_modules/babel-loader/lib??ref--2!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
 @ ./src/App.vue?vue&type=script&lang=js&
 @ ./src/App.vue
 @ ./src/main.js

似乎棉绒将.vue文件视为.css文件。

我需要做什么?

0 个答案:

没有答案