CSS Lint updated to 0.5.0
After a slight delay to figure out some UI changes, the 0.5.0 release of CSS Lint has now made it to csslint.net. As with previous releases, this release saw a mixture of bug fixes and new features. The biggest change you’ll notice on the web site is that rules are now categorized based on how they help your code. We received a lot of feedback that you weren’t sure why some rules were there. We hope that categorizing the rules will help clear up some of that confusion (there’s more documentation coming, we promise!). There were also a lot of changes under the hood, here are the highlights:
- cssguru pointed out that the
!importantrule didn’t tell you how the target usage count. That has been addressed.
- Eric created a one-line-per-file output format that matches JSHint’s output format.
- Senthil discovered a problem with the Rhino CSS Lint CLI where directories were not being read. The CLI has now been fixed and directories can be recursively read once again.
- The CSS parser now correctly supports CSS keyframe syntax and CSS escaping.
- cssguru also argued that having too many important declarations should not be an error. After some discussion, we agreed, and this is now a warning.
- mahonnaise suggested that a rule to detect the universal selector would be a good addition to the tool. We agreed, and 0.5.0 now warns when using the universal selector as the key selector.
- Oli found a bug in the box model rule where valid box model settings are flagged as problematic. This issue has been resolved.
- I added a rule that checks for known CSS properties and warns if the property is unknown. Vendor-prefixed properties are considered exceptions to this rule.
- Nicole added a rule that warns when a large negative
text-indentis used without first setting the
Of course, there are other miscellaneous fixes and tweaks that have gone into this release. If you’re using CSS Lint for Node.js, you can update by typing:
npm update csslint
Disclaimer: Any viewpoints and opinions expressed in this article are those of Nicholas C. Zakas and do not, in any way, reflect those of my employer, my colleagues, Wrox Publishing, O'Reilly Publishing, or anyone else. I speak only for myself, not for them.