Styleguides

Does someone knows a JSLinter to enforce some programmatic rules like do not use parseInt without base or do not use for(... in ...) loop?

I’ve discovered here that parseInt was used without giving a base, for instance.

Hey, I’d like to discuss about the two rules:

  • to not use ids selector
  • to not have a depth of 4 or more

I know ids selector are bad for performance, but I’m not sure that we need to be that strict about it.
And I would like to know why it’s bad to have a big depth? Scss is compiled anyway, I’m not sure why we want to avoid that, it’s even useful to avoid side effect.

And I would like to know why it’s bad to have a big depth? Scss is compiled anyway, I’m not sure why we want to avoid that, it’s even useful to avoid side effect.

As Steffen indicated me tonight, the given reason is that deep depth lead to a CSS tightly-coupled to your HTML structure.

Though, I tend to agree with you: I think the depth could be extended to 5.

Same about ID selectors. IMHO, there are legit use case.

You can find reasons for these rules in the scss-lint documentation.

IdSelector
SelectorDepth