A CSS linter that catches errors and enforces conventions in your stylesheets
open sourceMITfree
A linter for CSS with over 150 built-in rules for modern CSS syntax and features. It catches invalid or problematic code (malformed grid areas, duplicate selectors, misspelled properties) and enforces conventions (disallowed units, naming patterns for custom properties, limits on ID selectors, notations for color functions), fixes problems automatically where it can, and supports plugins for custom rules and shareable configs. Custom syntaxes extend it to styles embedded in HTML, Markdown and CSS-in-JS, and to CSS-like languages such as SCSS, Sass, Less and SugarSS. It runs as a CLI, a Node.js API and a PostCSS plugin, and its maintainers recommend running Prettier alongside it. MIT licensed.
Problems it solves
- catch CSS mistakes like duplicate selectors and misspelled properties before they ship
- enforce one set of CSS conventions across a team
- lint the SCSS and CSS-in-JS styles in my project in CI
Features
- over 150 built-in rules for modern CSS
- automatic fixes where possible
- plugins for custom rules
- shareable configs
- custom syntaxes for SCSS, Sass, Less, SugarSS and CSS-in-JS
- CLI, Node.js API and PostCSS plugin
Alternatives
The same job
These do what Stylelint does.