On this page
Overview
Stylelint is a CSS linter that detects syntax errors, duplicate selectors, unknown properties, and project-specific convention violations. It supports plugins, shareable configs, autofix, and custom syntaxes.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Detect modern CSS problems with more than 100 built-in rules
Rules cover invalid, unknown, or problematic CSS as well as naming, notation, selector limits, and other conventions.
Sources: [1]
Extend projects with plugins, shareable configs, and custom syntaxes
Teams can add custom rules, reuse configuration packages, and lint SCSS, Sass, Less, and other CSS-like syntaxes through adapters.
Sources: [1]
Best fit
Fits teams that want one CSS quality policy across editors, pre-commit checks, and CI
Rules and configs can be version-controlled and reused so local tooling and CI enforce the same stylesheet standards.
Sources: [1]
Before adoption
Version 17 requires ESM integration and Node 20.19.0 or later
Stylelint 17 removed the CommonJS Node.js API and support for Node versions below 20.19.0, requiring older integrations to migrate.
Keep linting separate from formatting responsibilities
The README recommends using a pretty printer such as Prettier alongside Stylelint because formatting and lint-rule enforcement are complementary concerns.
Sources: [1]
Official sources
- [1]Stylelint 17.16.0 README(2026-10-05)
- [2]Stylelint 17.16.0 package metadata(2026-10-05)
- [3]Stylelint v17 migration guide(2026-10-05)
- [4]Stylelint 17.16.0 changelog(2026-10-05)
- [5]Stylelint 17.16.0 release(2026-10-05)
- [6]Stylelint MIT license(2026-10-05)
Supplemental curator note
Stylelint 17 removes the CommonJS Node.js API and is ESM-oriented. It requires Node 20.19.0 or later, and the default --fix mode changed to strict, so older integrations should follow the v17 migration guide.
Try it in 3 steps
- 1
Install Stylelint 17.16.0 in an isolated project
Pin version 17.16.0 on Node.js 20.19.0 or later.
demo=$(mktemp -d "${TMPDIR:-/tmp}/stylelint.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact --save-dev stylelint@17.16.0 - 2
Create a rule config and CSS with a violation
Use a built-in rule and an invalid hex color to create a deterministic lint failure.
printf "%s\n" "export default {" " rules: {" " 'color-no-invalid-hex': true" " }" "};" > stylelint.config.mjs && printf "%s\n" '.bad { color: #12zzzz; }' > input.css - 3
Run the CLI and confirm the lint error
Confirm Stylelint returns a non-zero status for the violation so the same check can fail CI.
if npx stylelint input.css; then exit 1; else echo "lint error detected"; fi
Growth
Growth trends · Last 30 days
11,526 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- css
- enforce-conventions
- lint
- linter
- postcss
- Stars
- 11,526
- Forks
- 1,024
- Watchers
- 90
- Open issues
- 144
- Owner type
- Organization
- Primary language
- JavaScript
- License
- MIT
- Repository last updated
- Oct 1, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Linaria12,350 Stars
3 shared tag(s) · 1 shared category(s)
keep CSS-in-JS authoring while extracting styles to static CSS at build time
TypeScript - vanilla-extract10,435 Stars
3 shared tag(s) · 1 shared category(s)
write type-safe styles in TypeScript and extract them to static CSS at build time
TypeScript - PurgeCSS8,050 Stars
3 shared tag(s) · 1 shared category(s)
scan content files and keep only selectors that are actually referenced
TypeScript - Autoprefixer22,211 Stars
4 shared tag(s) · 1 shared category(s) · Same language
generate only the vendor prefixes required by Browserslist and Can I Use data
JavaScript - Less17,025 Stars
4 shared tag(s) · 1 shared category(s) · Same language
compile stylesheets with variables, mixins, and nesting into standard CSS with lessc
JavaScript - Stylus11,333 Stars
4 shared tag(s) · 1 shared category(s) · Same language
use indented syntax or regular CSS style with one expressive stylesheet compiler
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.