2

I was searching for linters in PhpStorm's plugin directory, but there are no results, which seems strange to me. Are people not using linters for their stylesheets in PhpStorm?

Is there any other way to lint LESS files in a PhpStorm project?

For example, I need all properties to be sorted alphabetically within a class definition.

pwagner
  • 1,224
  • 1
  • 13
  • 31
  • 2
    **2016.3** (not yet released, RC now) supports [stylelint](https://github.com/stylelint/stylelint) (see a basic description [here](https://blog.jetbrains.com/webstorm/2016/09/webstorm-2016-3-eap-163-4830-stylelint-usages-for-default-exports-and-more/)). For sorting properties -- try CSSComb plugin. – LazyOne Nov 22 '16 at 10:11
  • Thanks for the hint! On http://csscomb.com/, I cannot see a plugin for PhpStorm, but e.g. one for Grunt. How would you include CSSComb? As a Grunt task? Or am I missing something? – pwagner Nov 22 '16 at 14:25
  • 1
    "Css Alphabetical Rearanger" or "CSSReorder" plugins (2nd one uses CSSComb) -- install from inside PhpStorm. For simple/manual A-Z line ordering you may also use "String Manipulation" or "Shifter" plugins (they have other very useful features so worth checking them anyway). There is also custom "scss-lint" plugin for linting. – LazyOne Nov 22 '16 at 15:09
  • Thank you, @LazyOne – pwagner Nov 24 '16 at 08:24

1 Answers1

1

At this time, there is no easy way to automatically rearrange the style properties in LESS files using a PhpStorm plugin. (The stylint plugin in in version 2016.3 does not affect LESS files).

I ended up building a grunt task for CSSComb, which works fine.

pwagner
  • 1,224
  • 1
  • 13
  • 31