stylelint
    Overview
    Documentation
    Code
    Playground
    Issues
    Insights
    Contributors
    Dependencies
    Versions
    Alternatives

stylelint

A mighty, modern CSS linter.

10.1.0  •  Published 3 months ago  •  by stylelint  •  MIT License

NPM version Build Status Build status NPM Downloads Backers on Open Collective Sponsors on Open Collective

A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.

Features

It’s mighty because it:

  • understands the latest CSS syntax including custom properties and level 4 selectors
  • extracts embedded styles from HTML, markdown and CSS-in-JS object & template literals
  • parses CSS-like syntaxes like SCSS, Sass, Less and SugarSS
  • has over 170 built-in rules to catch errors, apply limits and enforce stylistic conventions
  • supports plugins so you can create your own rules or make use of plugins written by the community
  • automatically fixes some violations (experimental feature)
  • is well tested with over 10000 unit tests
  • supports shareable configs that you can extend or create your own of
  • is unopinionated so you can tailor the linter to your exact needs
  • has a growing community and is used by Facebook, GitHub and WordPress

Example output

Example

Getting started

It’s easy to get started.

First, decide how you want to use stylelint:

Then create your configuration object. You can either extend a shared configuration or craft your own.

Extend a shared configuration

This is the quickest way to get started. We suggest you extend either:

The recommended config turns on just the possible error rules. The standard config extends it by turning on 60 stylistic rules. We suggest you extend the:

  • recommended config if you use a pretty printer like prettier
  • standard config if you want stylelint to enforce stylistic conventions

You may want to add rules to your config that limit language features as these will be specific to your team and/or project.

If you use language extensions, for example @if and @extends, you can use a community config like stylelint-config-recommended-scss instead.

Craft your own config

Alternatively, you can learn about the rules and then either:

Guides

You’ll find detailed information on customising stylelint in our guides:

Need help?

Read our FAQ first.

If the answer to your problem isn’t there, then post it on stackoverflow.

Create a new issue if:

  • you think you’ve found a bug
  • you have a feature request

If you’re upgrading, read our CHANGELOG to learn what changes to expect in the latest version.

Help out

To help out, you can:

Our VISION document guides our work.

Semantic Versioning Policy

We have a semantic versioning policy. Any minor update may report more errors than the previous release. As such, we recommend using the tilde (~) in package.json e.g. "stylelint": "~7.2.0" to guarantee the results of your builds.

License

The MIT License.

Contributors

This project exists thanks to all these people. Contribute.

Backers

Thank you to all our backers! Become a backer.

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.

Popularity

Weekly Downloads
1.1M
Stars
6.8K

Maintenance

Development

Last ver 3 months ago
Created 5 years ago
Last commit 2 months ago
20 hours between commits

Technology

Node version: 10.15.3
1436.5K unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

146 contributors
Richard Hallows
Maintainer, 275 commits, 328 merges, 317 PRs
David Clark
Maintainer, 9 commits, 516 merges, 255 PRs
Works at mapbox
greenkeeper[bot]
172 commits
Stephen Edgar
88 commits, 18 merges, 58 PRs
Works at netweb
Aleks Hudochenkov
Maintainer, 99 commits, 1 PRs
ota
55 commits

Tags

css
less
sass
scss
sugarss
lint
linter
stylelint