Fanbneyl
Fanbneyl

Reputation: 393

How to fix "1 error potentially fixable with the `--fix` option" when using vue.js?

When compiling my vue.js (v 3.10.0) project, I get a error which says "1 error potentially fixable with the --fix option." because of eslint.

I have already searched for some solutions, that said I had to change some config-files but I couldn't find any of the described files. I also tried to use npm run lint -- --fix and it worked, but I do not want to execute this line of code every time.

Is there any way to do this, so for example like to "disable" eslint?

Upvotes: 18

Views: 23555

Answers (2)

hamid choopani
hamid choopani

Reputation: 164

It was fixed with this command

npm run lint -- --fix

If you want to disable (prettier/prettier) use this code. In the .eslintrc.json file

rules: { 
'prettier/prettier': 'off' 
}

Upvotes: 1

Andrew Vasylchuk
Andrew Vasylchuk

Reputation: 4779

You can run this command right before vue-cli-service build. Just modify your package.json "scripts" section. package.json:

...
"build": "npm run lint -- --fix && vue-cli-service build",
...

ES Lint removing:

Just drop these lines of code into your vue.config.js:

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

Upvotes: 22

Related Questions