Stylelint is a popular linter for CSS.
The mozlint integration of Stylelint can be run using mach:
$ mach lint --linter stylelint <file paths>
Alternatively, omit the
--linter stylelint and run all configured linters, which will include
Stylelint also supports the
--fix option to autofix most errors raised from most of the rules.
See the Usage guide for more options.
Understanding Rules and Errors¶
Common Issues and How To Solve Them¶
This code should neither be linted nor formatted¶
The global configuration file lives in
For an overview of the supported configuration, see Stylelint’s documentation.
Please keep differences in rules across the tree to a minimum. We want to be consistent to make it easier for developers.
Gijs Kruitbosch (gijs) owns the builders. Questions can also be asked on #lint:mozilla.org on Matrix.
This is a tier-1 task. For test failures the patch causing the issue should be backed out or the issue fixed.
Some failures can be fixed with
./mach lint -l stylelint --fix path/to/file.
For test harness issues, file bugs in Developer Infrastructure :: Lint and Formatting.