Search code examples
vuejs2vue-cli

How to disable eslint on vue-cli 3?


I recently update the laster version vue-cli 3

After creating a project and run it, it will show the message

  • You may use special comments to disable some warnings.
  • Use //eslint-disable-next-line to ignore the next line.
  • Use /* eslint-disable */ to ignore all warnings in a file.

but in Which file should I put those comments?

I only have a package.json / package-lock.json and .gitignore on my root folder

Do I have to create a .eslintrc?


Solution

  • You can remove the eslint rule by adding a vue.config.js file to your project with the following content.

    module.exports = {
        chainWebpack: config => {
            config.module.rules.delete('eslint');
        }
    }
    

    Alternatively if your project has a config\index.js file you can disable eslint by adding the following line.

    useEslint: false,