27 – CSS Lint (Stylelint)
The test runs Stylelint against the website's stylesheets and counts errors and dubious constructs.
What is tested?
Among the checks are:
- unknown functions
- unknown values for properties
- unknown type selectors
- invalid preludes for at-rules
- unknown annotations
The checks cover things that are wrong, not code style. Properties that don't exist. Values the browser won't understand. Rules that will never do anything.
How it affects the score
Each rule violation counts at its severity. Many instances of the same error weigh less than many different errors, because the former is usually fixed in one place.
Running the test
python default.py -u https://example.com -t 27 -r
Worth knowing
The test audits the CSS actually delivered to the visitor. If the stylesheet is minified, line numbers in the review can be hard to map back to your source.