csswebstormstylelint

Stylelint fix in WebStorm


I configured stylelint in my WebStorm (2018.2.3) in Settings -> Languages and Frameworks -> Stylesheets -> Stylelint. And I have .stylelintrc in my root.

Right now stylelint successfully underlines errors in my css file. But is there a way to fix them also with WebStorm help (without running --fix command in console)?


Solution

  • I created the external tool in Settings | Tools | External Tools, like this:

    enter image description here

    And then added the shortcut keymap for this command in here:

    enter image description here

    So now it fixes the whole file on the keymap press