stylelint/stylelint


A mighty, modern style linter

https://stylelint.io/

License: MIT

Language: JavaScript

Keywords: css, css-in-js, enforce-conventions, html, less, lint, linter, markdown, postcss, sass, scss, sugarss


stylelint

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.

Contributing Guidelines

Check out the Contributing Guidelines.

Contributors

Without all these wonderful people this project would cease to exist.

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.

Project Statistics

Sourcerank 21
Repository Size 10.2 MB
Stars 6,983
Forks 641
Watchers 93
Open issues 161
Dependencies 72
Contributors 244
Tags 138
Created
Last updated
Last pushed

Top Contributors See all

David Clark jeddy3 Evilebot Tnawi greenkeeper[bot] Stephen Edgar Aleks Hudochenkov Yosuke Ota Mike Allanson MoOx 刘祺 Ivan Kopeykin Casey Ydenberg Greenkeeper Makoto Tateno Stéphane Goetz Sendil Kumar N Juriy Zaytsev Masafumi Koba dryoma jonathan schatz

Packages Referencing this Repo

stylelint
A mighty, modern CSS linter.
Latest release 11.0.0 - Updated - 6.98K stars
@leetcode/stylelint
Modern CSS linter
Latest release 6.8.0 - Published - 6.98K stars

Recent Tags See all

11.0.0 September 15, 2019
10.1.0 June 07, 2019
10.0.1 April 16, 2019
10.0.0 April 13, 2019
9.10.1 January 19, 2019
9.10.0 January 16, 2019
9.9.0 November 27, 2018
9.8.0 November 09, 2018
9.7.1 October 30, 2018
9.7.0 October 28, 2018
9.6.0 September 27, 2018
9.5.0 August 19, 2018
9.4.0 July 25, 2018
9.3.0 June 15, 2018
9.2.1 May 16, 2018

Interesting Forks See all

romannmk/stylelint
A mighty, modern CSS linter
JavaScript - Updated - 1 stars
Garbee/stylelint
A mighty, modern CSS linter
This repository is no longer available - 1 stars
autumnboo90/stylelint
A mighty, modern CSS linter
JavaScript - Updated - 1 stars
keeganstreet/stylelint
A mighty, modern CSS linter
JavaScript - Last pushed - 1 stars
defconcepts/stylelint
Modern CSS linter.
JavaScript - Published - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-09-15 14:46:38 UTC

Login to resync this repository