Hello,
As of late yesterday, stylelint <https://stylelint.io/> now lints CSS
files in mozilla-central. You can invoke it locally using `./mach lint
-l stylelint`, it can run for trypushes and autoland/mozilla-central
commits, etc. Similar to eslint, it can auto-fix some types of issues,
but not everything. There is also some initial documentation
<https://firefox-source-docs.mozilla.org/code-quality/lint/linters/stylelint.html>.
Thanks to Mark Banner, Dão Gottwald, Sylvestre Ledru and many others for
their speedy reviews and advice.
*What kind of issues does this detect?
*To start with, only correctness issues: CSS syntax issues, duplicate
property declarations in the same selector, broken property value
syntax, etc. To land it, we had to adjust a few typos (that broke CSS)
in our user agent sheet as well as various other places in the tree, so
it has already helped discover and fix bugs.
We will likely increase coverage by enabling more rules to enforce
conventions in use (e.g. using `em` sizing for fonts), help people write
text-direction agnostic CSS (using logical CSS properties rather than
physical ones) and so on, but this will happen gradually.
*I work on newtab/debugger, I thought we already had this?
*This new coverage is tree-wide, rather than specific to these 2
projects which already had a stylelint configuration. Right now those
separate configurations for new tab and debugger code still exist. We
will merge these into the main linter job soon
<https://bugzilla.mozilla.org/show_bug.cgi?id=1832765>.
*I found a bug / problem with the new linter!
*Uh oh. Please file under Developer Infrastructure :: Lint and
Formatting and needinfo me (if appropriate, mark as a regression from
the bug that landed support
<https://bugzilla.mozilla.org/show_bug.cgi?id=1508369>, and/or blocking
the metabug <https://bugzilla.mozilla.org/show_bug.cgi?id=1762027>).
*
*
Happy (CSS) Hacking!
Gijs
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/424454dd-5f85-2221-84db-069c6ef2f256%40mozilla.com.