🏳️Home | Stylelint

Website faviconstylelint.io

npm version

[Skip to main content](#__docusaurus_skipToContent_fallback)

On this page

[](https://www.npmjs.com/package/stylelint)[](https://github.com/stylelint/stylelint/actions/workflows/testing.yml?query=branch%3Amain)[](https://npmcharts.com/compare/stylelint?minimal=true)

A mighty CSS linter that helps you avoid errors and enforce conventions.

Features[​](#features "Direct link to Features")

------------------------------------------------

It's mighty as it:

*   has over **100 built-in rules** for modern CSS syntax and features

*   supports **plugins** so you can create your own custom rules

*   automatically **fixes problems** where possible

*   supports **shareable configs** that you can create or extend

*   can **be customized** to your exact needs

*   has **15k unit tests** making it robust

*   is **trusted by companies worldwide** like Google and GitHub

And it can be extended to:

*   extract **embedded styles** from HTML, Markdown and CSS-in-JS template literals

*   parse **CSS-like languages** like SCSS, Sass, Less and SugarSS

How it'll help you[​](#how-itll-help-you "Direct link to How it'll help you")

-----------------------------------------------------------------------------

It'll help you **avoid errors**, for example:

*   invalid things, e.g. malformed grid areas

*   valid things that are problematic, e.g. duplicate selectors

*   unknown things, e.g. misspelled property names

And **enforce conventions**, for example:

*   disallow things, e.g. specific units

*   enforce naming patterns, e.g. for custom properties

*   set limits, e.g. the number of ID selectors

*   specify notations, e.g. for modern color functions

We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

Example output[​](#example-output "Direct link to Example output")

------------------------------------------------------------------

Guides[​](#guides "Direct link to Guides")

------------------------------------------

*   User guide

    *   [Getting started](/user-guide/get-started)

    *   [Customizing](/user-guide/customize)

    *   [Configuring](/user-guide/configure)

    *   [Rules](/user-guide/rules)

    *   [Ignoring code](/user-guide/ignore-code)

    *   [CLI](/user-guide/cli)

    *   [Node.js API](/user-guide/node-api)

    *   [PostCSS plugin](/user-guide/postcss-plugin)

    *   [Options](/user-guide/options)

    *   [Errors & warnings](/user-guide/errors)

*   Developer guide

    *   [Writing rules](/developer-guide/rules)

    *   [Writing plugins](/developer-guide/plugins)

    *   [Writing custom syntaxes](/developer-guide/syntaxes)

    *   [Writing custom formatters](/developer-guide/formatters)

    *   [Writing system tests](/developer-guide/system-tests)

*   Migration guide

    *   [Migrating to 16.0.0](/migration-guide/to-16)

    *   [Migrating to 15.0.0](/migration-guide/to-15)

    *   [Migrating to 14.0.0](/migration-guide/to-14)

*   Maintainer guide

    *   [Managing issues](/maintainer-guide/issues)

    *   [Managing pull requests](/maintainer-guide/pull-requests)

    *   [Performing releases](/maintainer-guide/releases)

*   About

    *   [Vision](/about/vision)

    *   [Governance](/about/governance)

    *   [Semantic versioning](/about/semantic-versioning)

Contributors[​](#contributors "Direct link to Contributors")

------------------------------------------------------------

Stylelint is maintained by volunteers. Without the code contributions from [all these fantastic people](https://github.com/stylelint/stylelint/graphs/contributors), Stylelint would not exist. [Become a contributor](/CONTRIBUTING).

### Alumni[​](#alumni "Direct link to Alumni")

We'd like to thank all past members for their invaluable contributions, including two of Stylelint's co-creators [@davidtheclark](https://github.com/davidtheclark) and [@MoOx](https://github.com/MoOx).

### Sponsors[​](#sponsors "Direct link to Sponsors")

Thank you to all our sponsors! [Become a sponsor](https://opencollective.com/stylelint).

### Backers[​](#backers "Direct link to Backers")

Thank you to all our backers! [Become a backer](https://opencollective.com/stylelint).

### Website hosting[​](#website-hosting "Direct link to Website hosting")

[](https://www.netlify.com)

License[​](#license "Direct link to License")

---------------------------------------------

[The MIT License](https://raw.githubusercontent.com/stylelint/stylelint/main/LICENSE).