How to disable ESLint in vue-cli?

2019-01-18 02:22发布

How do I go about disabling ESlint in project generated with vue-cli?

preLoaders: [
  {
    test: /\.vue$/,
    loader: 'eslint',
    include: projectRoot,
    exclude: /node_modules/
  },
  {
    test: /\.js$/,
    loader: 'eslint',
    include: projectRoot,
    exclude: /node_modules/
  }
]

If I remove the loader: 'eslint' line it won't compile, same with setting it to an empty string. I know I can opt out of ESLint during the initialization phase, but how can I disable it after my project has been created?

5条回答
该账号已被封号
2楼-- · 2019-01-18 02:59

There's a hell lot of solutions here: https://github.com/vuejs-templates/webpack/issues/73

However the best one is :
To add a line of **/* to .eslintignore, which will ignore all files. And then re-run, if it's a web app!

查看更多
一夜七次
3楼-- · 2019-01-18 03:00

Set useEslint: false, in config/index.js

see this image

查看更多
爱情/是我丢掉的垃圾
4楼-- · 2019-01-18 03:02

In the latest version, open the ".eslintrc.js" file, and set "root: false".enter image description here

查看更多
够拽才男人
5楼-- · 2019-01-18 03:03

Vue's starter projects are themselves built with a templating language.

Looking at the templates (the {{#lint}} bits) it appears you can remove the entire preLoaders block.

查看更多
我命由我不由天
6楼-- · 2019-01-18 03:12

As of the current version (^3.0?) you can just set:

useEslint: false,

in config/index.js

查看更多
登录 后发表回答