Friday, February 17, 2017

grumblesmurf: pointless css lint rules

I've already done my curmudgeonly grumble about linting, but today I ran into one lint rule that means especially pointless: length-zero-no-unit, that any length measure that's zero should not have units.

A zero length is a zero length of px, em, cm, or whatever, but for some reason some Lint-heads decide that a since a zero "CAN be an unlabeled" it "SHOULD be unlabeled" (which then gets parlayed into "MUST be unalabled", if your company enforces linting rules for builds.) This page tries to justify it as "saving bytes", which is a pretty weaksauce argument in a world minification and what not.

The other argument is "consistency", but actually I think it makes things more inconcistent: if you have a bunch of "px" values, but one of them happens to be zero, it's not allowed that it be a "0px" measure like its siblings.

In the chat though my department lead came down on the side of not establishing a mechanism for the group to vote down irksome lint-rules. I think it's less that this particular rule is defensible, and more that they want to avoid the quagmire of long debates about other rules that developers find pointless or excessively pedantic.

No comments:

Post a Comment