koreader / crengine

This is the KOReader CREngine fork. It cross-pollinates with the official CoolReader repository at https://github.com/buggins/coolreader, in case you were looking for that one.
70 stars 45 forks source link

[CI] Add stylelint to prevent typos in CSS #556

Closed Frenzie closed 6 months ago

Frenzie commented 6 months ago

In reply to https://github.com/koreader/crengine/pull/555#issuecomment-1970053271

This is an initial poc. Some of the rules like length-zero-no-unit definitely make sense to me, but the existing code is full of things like 0px and I dislike changing things for the sake of changing them.

For -cr-etc I think we should be able to define a custom-property-pattern (as a regex).

For selector-type-no-unknown we should do something like "ignoreTypes": ["genre", "author", "etc"]. Disabling it completely would probably defeat the purpose.

And so on.

I don't know if I'll continue on this tonight, but this way the (rather excessive) list of complaints is already available to see.


This change is Reviewable

poire-z commented 6 months ago

You should ignore all the obsolete ones we won't ever touch, and just check epub.css and html5.css (and fb2.css maybe but it has lots of non-HTML element names).

Lots of noise indeed :) I probably won't reorder stuff for specificity, so it probably just warn instead of erroring.

Frenzie commented 6 months ago

It seemed to be unhappy with binding: keygen from https://github.com/koreader/crengine/pull/300 btw, but I'm not sure if there's anything to that or if it's just being overly strict.

Anyway, I think this should about do it.

poire-z commented 6 months ago

It seemed to be unhappy with binding: keygen

That's in the old/current html5.css, that will be replaced in #555.

poire-z commented 6 months ago

Looks ok to me, we'll see what it does with #555.