[Vuejs]-How to setup css linting in Vue.js project with auto-correction

1👍

Found a solution) I used stylelint from This post, without ‘processor'(it’s deprecated).
Add stylelint and stylelint-config-standard packages to your project (you may use yarn instead of npm):

npm i --save-dev stylelint stylelint-config-standard

Create .stylelintrc in the main directory with the following content:

{
 "extends": "stylelint-config-standard"
}

For putting some files to ignore list create .stylelintignor and add them(syntaxis same as .gitignor)

As a result, Stylelint will lint and fix(depends on editor settings) .css files and <style> segment in .vue files.

0👍

Have you tried Prettier extension of Visual Studio Code?

Leave a comment