去掉vue 中的代码规范检测(Eslint验证)

 

目录(?)[+]

 

我们在使用vue 脚手架时,为了规范团队的代码格式,会有一个代码规范检测,如果不符合规范就会报错,有时候我们不想按照他的规范去写。这时我们需要关闭。这里有两种方法。

1.在搭建vue脚手架时提示是否启用eslint检测的。 Use ESLint to lint your code? 写 no;

2.如果项目已经生成,我们可以这样。

在项目中代开 bulid 文件夹下的 webpack.base.config.js 文件。将以下代码删掉或注销:

{
   test: /\.(js|vue)$/,
   loader: 'eslint-loader',
   enforce: 'pre',
   include: [resolve('src'), resolve('test')],
   options: {
     formatter: require('eslint-friendly-formatter')
   }
 },

猜你喜欢

转载自baobeituping.iteye.com/blog/2394461