
Stylelint
A CSS linter that catches errors and enforces style conventions in your stylesheets.
- Stars
- 11.5k
- Forks
- 1k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 8 days ago
- Type
- Dev tool
What it is
Stylelint checks CSS and CSS-like code for mistakes, such as malformed grid areas, misspelled property names, or duplicate selectors, and for style rules your team chooses, such as disallowed units or naming patterns. It can also automatically fix some problems. The README says it has over 150 built-in rules and supports plugins and shareable configs.
- Flag invalid or misspelled CSS properties in a project's stylesheets
- Enforce naming patterns for custom properties
- Set limits such as the number of ID selectors allowed
- Extract and lint styles embedded in HTML, Markdown, or CSS-in-JS template literals
Great for
- Front-end teams that want consistent CSS across a shared codebase
- Developers who want to catch typos and invalid CSS before it ships
- Projects that write SCSS, Sass, or Less and want linting for those syntaxes
- Teams that already use Prettier and want a linter alongside it
Not ideal for
- People who only need to write a few static CSS rules and do not want a Node.js toolchain (the project is distributed as a JavaScript package, per its JavaScript language and npm badges)
- Anyone looking for a visual editor or a CSS preprocessor; Stylelint only checks code
How to get it
- 1
Install with a package manager
You'll need: Node.js
Clone the repository
git clone https://github.com/stylelint/stylelint - 2
Run it
- Read the Getting started guide at docs/user-guide/get-started.md
- Install Stylelint as a project dependency using the npm package
- Create a configuration file as described in the Configuring guide
- Run the CLI from the command line against your stylesheets
- 3
Get the most out of it
- Pair it with Prettier, which the README recommends for consistent formatting
- Use the Customizing and Configuring guides to select only the rules you need
- Write your own rules with the plugin guide at docs/developer-guide/plugins.md
- Extend it to other syntaxes with the custom syntaxes guide if you use CSS-in-JS or embedded styles
Downloads
Strengths
- Large built-in rule set, described as over 150 rules in the README
- Can automatically fix some problems where possible
- Supports plugins and shareable configs so teams can customize or extend it
Trade-offs
- Setup and rule configuration require some familiarity with Node.js tooling and config files
- The README does not detail configuration specifics here, so teams will need to read the linked docs to tune rules
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| stylelint (this) | 11.5k | Dev tool | intermediate | 8 days ago | Front-end teams that want consistent CSS across a shared codebase |
| prettier | 52.4k | Dev tool | beginner | 4 days ago | Teams that want one shared code style without writing their own rules |
| parcel | 44k | Dev tool | beginner | 4 days ago | Web developers who want a bundler that works without a config file |
| esbuild | 40.1k | Dev tool | intermediate | 3 months ago | Developers who want fast builds for JavaScript, TypeScript, or CSS projects |
| standard | 29.4k | Dev tool | beginner | 1.3 years ago | JavaScript projects where the team wants consistent style without debating rules |
| postcss | 29k | Dev tool | intermediate | 4 days ago | Web developers who want to automate CSS fixes such as vendor prefixes |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.