17

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?

1
  • FYI, the special comments are a way of disabling eslint on specific portions of your code. Commented Feb 20, 2020 at 12:22

4 Answers 4

43

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,
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I created the vue.config.js file, then added your code. It worked!
This doesnt seem to work anymore in latest vue
Perhaps we can use this method now: cli.vuejs.org/core-plugins/eslint.html#configuration
4

This is work for me

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

1 Comment

finally, after hours of trying all kinds of settings and ignore files, this is the one and only single thing that worked!
3

if you are unable to disable it just remove it by using the below command

 npm remove @vue/cli-plugin-eslint

The below code is used to disable it:

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

Comments

2

You would put /* eslint-disable */ in a vue file to ignore eslint checks in that particular file. You can create a .eslintrc file to change the rules eslint should check for.

3 Comments

For details on how to configure eslint see eslint.org/docs/user-guide/configuring
I put it in all my components... and still getting the same message /* eslint-disable */ inside the script tag
even if I remove "eslintConfig": { "root": true, "extends": [ "plugin:vue/essential", "eslint:recommended" ] }, from the package.json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.