Page MenuHomePhabricator

Devise a recommended grunt configuration for linting and style-checking CSS files that isn't CSSlint
Closed, ResolvedPublic

Description

CSSlint, our current recommendation, is limited to some basic linting. It doesn't do advanced linting like "only use features that are compatible with IE6+" or whatever. It doesn't do any style checking (e.g. consistent ordering of attributes), and hasn't had a release in over two years (August 2013).

There are some possible replacements (stylelint most obviously), but we should work out what we think is best and just do it.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 23 2016, 3:26 PM
Jdforrester-WMF moved this task from Blocked to Accepted on the Front-end-Standards-Group board.
Jdforrester-WMF closed this task as Resolved.May 17 2016, 5:28 PM
Jdforrester-WMF added a subscriber: Esanders.

OK, this is now Resolved.

VE, VE-MW, Cite, and OOUI repos are now using it; we'll convert other repos as we go. Thanks to @Esanders.

hashar added a subscriber: hashar.May 17 2016, 6:44 PM

@Jdforrester-WMF & @Esanders that looks great :-}  Maybe you could announce it on wikitech-l to get more people to switch to Stylelint?

Extra bonus point and extra round of your favorite beverage if one ever comes up with a wikimedia-lint that depends on banana/jscs/jshint/Stylelint.. with appropriate conf :-]

Extra bonus point and extra round of your favorite beverage if one ever comes up with a wikimedia-lint that depends on banana/jscs/jshint/Stylelint.. with appropriate conf :-]

Don't expect any beverage from me. I prefer individual packages which are easier to update and customize one at a time.

Yes, this is really great and I'm happy to see that my questions on state of CSS have led to these solid answers! Thanks again.

The centralized stylelint-config-wikimedia repo will help us enormously. There's just one disadvantage I've come across so far: You can't ignore one of the style rules set in the central config, you can just decide for black or white, not for ignore files as is on the specific rule again.
Therefore we have to be careful which central rules we're agreeing on and which we'll leave up to the projects themselves, otherwise we'll see source code full of stylelint-disable notices or projects not using it at all.

block-closing-brace-space-after is one of these examples, at-rule-empty-line-before is another. See https://gerrit.wikimedia.org/r/#/c/289599/

"string-quotes": [ "single" ] on the other hand should be discussed more broadly before setting it centralized, for example in Front-end-Standards-Group – there's no guideline of it at https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS yet.