A
A
Anton M2019-11-21 13:26:49
Web development
Anton M, 2019-11-21 13:26:49

Is it possible to format code using rules from .stylelintrc?

This refers to the "Format Document" function.
I tried to do as described here
It did not work. The code is formatted in a standard way.
Or how to change the Prettier configuration file?
This is described here, but it also did not work out (put .prettierrc in the root of the project).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton M, 2020-05-21
@Bluorenge

You need to install the stylelint extension in the editor.
Install `stylelint` in devdependencies.
I also set `stylelint-order` to check the order of the style rules.
Enable format option on save:

"editor.codeActionsOnSave": {
    "source.fixAll.stylelint": true
  }

With these settings, formatting will be performed from the .stylelintrc file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question