Styleguides


(Augier) #61

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.


(Flaburgan) #62

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.


(Augier) #63

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.


(Steffen van Bergerem) #64

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

IdSelector
SelectorDepth