vue.js - 如何给vue文件使用eslint --fix

查看:715
本文介绍了vue.js - 如何给vue文件使用eslint --fix的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

配置如下

module.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {
    sourceType: 'module'
  },
  env:{
    "browser": true,
    "node": true,
    "es6": true
  },
  // required to lint *.vue files
  // extends: 'vue',
  plugins: [
    'html',
    // 'vuefix'

  ],
  // add your custom rules here
  rules: {...}
}

装了eslint-plugin-html也不行,使用extends:'vue'或者plugins:['vuefix']又会提示找不到eslint-plugin-vuefix,但我已经安装了。

求教,不能自动fix,自己改会死人。。。

解决方案

自问自答,
关键在于plugins:[]这里,
如果将vuefix放在前面或者不用html就可以autofix了,
但不可以放在html后面。

这篇关于vue.js - 如何给vue文件使用eslint --fix的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆