# stylelint

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

Latest version **17.15.0** (published 2026-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install stylelint
pnpm add stylelint
yarn add stylelint
bun add stylelint
```

Provides the command `stylelint`.

## Health

**Score 78/100 (B)** — status: active.

Positive: has types package; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 17.15.0 |
| Published | 2026-09-04 |
| First published | 2014-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/stylelint) |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 35 |
| Unpacked size | 964.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11521 |
| Author | stylelint |
| Maintainers | jeddy3, ybiquitous, romainmenke, ntwb |
| Keywords | css-in-js, css, less, lint, linter, markdown, sass, scss, stylelint, sugarss |

## Links

- npm: https://www.npmjs.com/package/stylelint
- Repository: https://github.com/stylelint/stylelint
- Homepage: https://stylelint.io
- Issues: https://github.com/stylelint/stylelint/issues
- Funding: https://opencollective.com/stylelint
- npm.io page: https://npm.io/package/stylelint

## Dependencies (35)

- [meow](https://npm.io/package/meow.md) ^14.1.0
- [debug](https://npm.io/package/debug.md) ^4.4.3
- [table](https://npm.io/package/table.md) ^6.9.0
- [colord](https://npm.io/package/colord.md) ^2.10.0
- [globby](https://npm.io/package/globby.md) ^16.2.4
- [ignore](https://npm.io/package/ignore.md) ^7.0.6
- [postcss](https://npm.io/package/postcss.md) ^8.5.26
- [css-tree](https://npm.io/package/css-tree.md) ^3.2.1
- [globjoin](https://npm.io/package/globjoin.md) ^0.1.4
- [svg-tags](https://npm.io/package/svg-tags.md) ^1.0.0
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.3.3
- [html-tags](https://npm.io/package/html-tags.md) ^5.1.0
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.8
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.1
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^9.0.2
- [string-width](https://npm.io/package/string-width.md) ^8.2.2
- [global-modules](https://npm.io/package/global-modules.md) ^2.0.0
- [normalize-path](https://npm.io/package/normalize-path.md) ^3.0.0
- [file-entry-cache](https://npm.io/package/file-entry-cache.md) ^11.1.5
- [mathml-tag-names](https://npm.io/package/mathml-tag-names.md) ^4.0.0
- [write-file-atomic](https://npm.io/package/write-file-atomic.md) ^7.0.1
- [@csstools/css-calc](https://npm.io/package/@csstools/css-calc.md) ^3.3.0
- [css-functions-list](https://npm.io/package/css-functions-list.md) ^3.3.3
- [fastest-levenshtein](https://npm.io/package/fastest-levenshtein.md) ^1.0.16
- [import-meta-resolve](https://npm.io/package/import-meta-resolve.md) ^4.2.0
- [postcss-safe-parser](https://npm.io/package/postcss-safe-parser.md) ^7.0.1
- [supports-hyperlinks](https://npm.io/package/supports-hyperlinks.md) ^4.5.0
- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^4.2.0
- [@csstools/css-tokenizer](https://npm.io/package/@csstools/css-tokenizer.md) ^4.0.0
- [postcss-selector-parser](https://npm.io/package/postcss-selector-parser.md) ^7.1.5
- [@csstools/selector-specificity](https://npm.io/package/@csstools/selector-specificity.md) ^6.0.0
- [@csstools/css-parser-algorithms](https://npm.io/package/@csstools/css-parser-algorithms.md) ^4.0.0
- [@csstools/media-query-list-parser](https://npm.io/package/@csstools/media-query-list-parser.md) ^5.0.0
- [@csstools/selector-resolve-nested](https://npm.io/package/@csstools/selector-resolve-nested.md) ^4.0.1
- [@csstools/css-syntax-patches-for-csstree](https://npm.io/package/@csstools/css-syntax-patches-for-csstree.md) ^1.1.9

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 17.15.0 (latest) — 2026-09-04
- 17.14.1 — 2026-07-20
- 17.14.0 — 2026-06-25
- 17.13.0 — 2026-06-06
- 17.12.0 — 2026-05-20
- 17.11.1 — 2026-05-14
- 17.11.0 — 2026-05-05
- 17.10.0 — 2026-05-03
- 17.9.1 — 2026-04-27
- 17.9.0 — 2026-04-23
- 17.8.0 — 2026-04-15
- 17.7.0 — 2026-04-12
- 17.6.0 — 2026-03-26
- 17.5.0 — 2026-03-19
- 17.4.0 — 2026-02-25
- … 267 more at https://npm.io/package/stylelint/versions

## README

# Stylelint

[![npm version](https://img.shields.io/npm/v/stylelint?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint)
[![npm downloads](https://img.shields.io/npm/dm/stylelint)](https://npmcharts.com/compare/stylelint?minimal=true)
[![CI](https://github.com/stylelint/stylelint/actions/workflows/ci.yml/badge.svg)](https://github.com/stylelint/stylelint/actions/workflows/ci.yml)

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

## 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

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](example.png)

## Guides

- User guide
  - [Getting started](docs/user-guide/get-started.md)
  - [Customizing](docs/user-guide/customize.md)
  - [Configuring](docs/user-guide/configure.md)
  - [Rules](docs/user-guide/rules.md)
  - [Ignoring code](docs/user-guide/ignore-code.md)
  - [CLI](docs/user-guide/cli.md)
  - [Node.js API](docs/user-guide/node-api.md)
  - [PostCSS plugin](docs/user-guide/postcss-plugin.md)
  - [Options](docs/user-guide/options.md)
  - [Errors & warnings](docs/user-guide/errors.md)
- Developer guide
  - [Writing plugins](docs/developer-guide/plugins.md)
  - [Writing custom syntaxes](docs/developer-guide/syntaxes.md)
  - [Writing custom formatters](docs/developer-guide/formatters.md)
- Migration guide
  - [Migrating to 17.0.0](docs/migration-guide/to-17.md)
  - [Migrating to 16.0.0](docs/migration-guide/to-16.md)
  - [Migrating to 15.0.0](docs/migration-guide/to-15.md)
  - [Migrating to 14.0.0](docs/migration-guide/to-14.md)
- Contributor guide
  - [Contributing](CONTRIBUTING.md)
  - [Writing rules](docs/contributor-guide/rules.md)
  - [Writing system tests](docs/contributor-guide/system-tests.md)
  - [Benchmarking](docs/contributor-guide/benchmarks.md)
- Maintainer guide
  - [Managing issues](docs/maintainer-guide/issues.md)
  - [Managing pull requests](docs/maintainer-guide/pull-requests.md)
  - [Performing releases](docs/maintainer-guide/releases.md)
- About
  - [Vision](docs/about/vision.md)
  - [Governance](docs/about/governance.md)
  - [Semantic versioning](docs/about/semantic-versioning.md)
  - [Support](SUPPORT.md)
- [Changelog](CHANGELOG.md)

## 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.md).

### 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, backers and donors

Financial contributions help us dedicate time to Stylelint and cover our infrastructure costs.

A big thank you to everyone who sponsors us on [Open Collective](https://opencollective.com/stylelint/):

<object data="https://opencollective.com/stylelint/sponsors.svg?width=420&button=false" type="image/svg+xml">
  <img src="https://opencollective.com/stylelint/sponsors.svg?width=840&button=false" />
</object>

And thank you to all our Open Collective backers, GitHub sponsors and one-off donors.

[Contribute via Open Collective](https://opencollective.com/stylelint/contribute) or [sponsor us on GitHub](https://github.com/sponsors/stylelint).

#### Website hosting

[![Deploys by Netlify](https://www.netlify.com/assets/badges/netlify-badge-dark.svg)](https://www.netlify.com)

## License

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

---
_Source: https://npm.io/package/stylelint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
