A mighty, modern CSS linter that helps you enforce consistent conventions and avoid errors in your stylesheets.
Upgrading? Please read our CHANGELOG to learn what changes to expect in the latest version, whether that's new features, bug fixes, renamed rules, or whatever else.
With stylelint, it's easy to start linting your CSS:
Decide how you want to use stylelint:
Create your configuration object (probably as a
.stylelintrc file) by either crafting your own config or extending a pre-written, shared config.
- If you want to use a pre-written config, just find one and extend it. We recommend trying
stylelint-config-standard, which includes over 80 of stylelint's rules with sensible defaults. (You can always override specific rules after extending a config.)
- To craft your own from the ground up, learn about rules. All of the rules are off by default, so you only have to learn about the rules you want to turn on and enforce. That way you can start small, growing your config over time as you have a chance to explore more of the rules. Alternately, copy-paste this example configuration, which lists all of stylelint's rules and their primary options, then remove (or turn off) the rules you don't want and edit the primary option of each rule to your liking.
Be sure to specify the syntax if you're using non-standard syntax (e.g. SCSS, SugarSS or Less).
You'll find more detailed information on using stylelint and tailoring it to your needs in our guides:
- User guide - Usage, configuration, FAQ and complementary tools.
- Developer guide - Contributing to stylelint and writing your own plugins & formatters.
There is always a lot of work to do, and already well over 100 rules to maintain. So please help out in any way that you can:
- Create, enhance, and debug rules (see our guide to "Working on rules").
- Improve documentation.
- Chime in on any open issue or pull request.
- Open new issues about your ideas for making stylelint better, and pull requests to show us how your idea works.
- Add new tests to absolutely anything.
- Work on improving performance of rules.
- Create or contribute to ecosystem tools, like the plugins for Atom and Sublime Text.
- Spread the word.
We communicate via issues and pull requests.
There is also stackoverflow, which is our preferred QA forum. Tag your post with "stylelint".