Project built with vue-cli (turns on automatic formatting of eslint), webstorm and eslint conflicts with error reporting.

I generated a project with vue-cli that turned on the detection of eslint, but the eslint error was caused by the shortcut formatting code of webstorm.
where the .editorconfig file in the project generated by vue-cli is shown in the following figure:
clipboard.png

webstorm:

clipboard.png

ctrl+alt+Leslint:

clipboard.png

is there a way to format the code without conflicts with eslint?

Mar.03,2021

A lot of people encounter this problem, and there are a lot of people talking nonsense there.
Let's first say that this problem is due to a problem with webstorm formatting, which has nothing to do with eslint. You shouldn't use eslint to solve it.
this is how I solved it.
webstorm Settings page-> Editor- > Code Style
there is a set from, on the top right of JavaScript in the < Editor- > Code Style
. I set it to the Standard style I want, and then there is a Do not indent children of, plus a script, in the Other tab in HTML and save the format to see the effect


.

right on .eslintrc.js , there is a "Apply ESLint Code Style Rule" click on it at the bottom of the menu, and then automatic formatting will follow the rules of eslint

.

add: this feature has been available since WebStorm 2017.3


clipboard.png

one picture is worth ten thousand words

Menu