stylelint-config-recommended, stylelint-config-standard, and stylelint-config-sass-guidelines are shared configuration packages for Stylelint, a linter for CSS and related syntaxes. They provide pre-defined rule sets to enforce code quality and consistency. stylelint-config-recommended offers a minimal set of rules that prevent errors in valid CSS. stylelint-config-standard extends the recommended config with opinionated stylistic rules for consistent formatting. stylelint-config-sass-guidelines targets SCSS projects specifically, enforcing conventions from the Sass Guidelines project and requiring the stylelint-scss plugin for full functionality.
stylelint-config-recommended vs stylelint-config-standard vs stylelint-config-sass-guidelinesWhen setting up a CSS or Sass codebase, choosing the right Stylelint configuration can save hours of bikeshedding and enforce consistent, maintainable styles. The three packages — stylelint-config-recommended, stylelint-config-standard, and stylelint-config-sass-guidelines — serve different purposes and target different audiences. Let’s break down what each does, how they differ technically, and when to use which.
stylelint-config-recommendedThis is the minimal, safe baseline provided by the official Stylelint team. It only turns on rules that avoid errors — like invalid syntax or deprecated features — but doesn’t enforce stylistic preferences.
// .stylelintrc.json using stylelint-config-recommended
{
"extends": ["stylelint-config-recommended"]
}
It includes rules such as:
color-no-invalid-hexfunction-calc-no-invalidunit-no-unknownBut it does not include rules about spacing, ordering, or naming conventions.
stylelint-config-standardThis builds directly on top of stylelint-config-recommended and adds opinionated stylistic rules based on common community practices. Think of it as the “Prettier for CSS” — it enforces consistent formatting and structure.
// .stylelintrc.json using stylelint-config-standard
{
"extends": ["stylelint-config-standard"]
}
It enables everything from recommended, plus rules like:
declaration-block-trailing-semicolonindentationstring-quotesselector-list-comma-newline-afterThis config assumes you’re writing standard CSS (or PostCSS-compatible syntax) and want predictable, readable output.
stylelint-config-sass-guidelinesThis config is specialized for Sass (SCSS) projects and enforces rules aligned with the popular Sass Guidelines project. It focuses on Sass-specific best practices, including nesting depth, variable naming, and mixin usage.
// .stylelintrc.json using stylelint-config-sass-guidelines
{
"extends": ["stylelint-config-sass-guidelines"]
}
It includes rules like:
scss/at-rule-no-unknown (for Sass @mixin, @include, etc.)max-nesting-depth (defaults to 3)scss/dollar-variable-pattern (enforces $kebab-case)scss/selector-no-redundant-nesting-selectorNote: This package depends on stylelint-scss plugin and won’t work properly without it.
Each config has different assumptions about your tooling stack.
stylelint-config-recommended: Works out of the box with vanilla CSS. No plugins required.stylelint-config-standard: Also works with plain CSS. Uses built-in Stylelint rules only.stylelint-config-sass-guidelines: Requires stylelint-scss to understand Sass-specific syntax. Without it, you’ll get false positives or crashes.If you try to use stylelint-config-sass-guidelines on a plain CSS project, you’ll see errors like:
Unknown rule scss/at-rule-no-unknown
To fix this, install the plugin:
npm install --save-dev stylelint-scss
And ensure your config includes it:
{
"plugins": ["stylelint-scss"],
"extends": ["stylelint-config-sass-guidelines"]
}
All three configs are designed to be extended. But their inheritance chains differ:
stylelint-config-standard extends stylelint-config-recommended internally. So if you use standard, you automatically get all recommended rules.stylelint-config-sass-guidelines does not extend either. It’s a standalone config focused purely on Sass conventions.This means:
standard and sass-guidelines, you must manage potential rule conflicts manually.recommended + sass-guidelines, skipping standard because some of its rules (like quote style) may conflict with Sass conventions.Example hybrid config for a modern SCSS codebase:
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-sass-guidelines"
],
"plugins": ["stylelint-scss"],
"rules": {
"scss/dollar-variable-pattern": "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$"
}
}
stylelint-config-standardstylelint-config-sass-guidelines + stylelint-config-recommendedrecommended covers basic CSS validity.stylelint-config-recommendedAs of the latest verified documentation:
stylelint-config-sass-guidelines explicitly states it’s intended for SCSS syntax only (not indented Sass).| Package | Error Prevention | Stylistic Rules | Sass Support | Requires Plugins |
|---|---|---|---|---|
stylelint-config-recommended | ✅ | ❌ | ❌ | ❌ |
stylelint-config-standard | ✅ | ✅ | ❌ | ❌ |
stylelint-config-sass-guidelines | ⚠️ (partial) | ✅ (Sass-focused) | ✅ | ✅ (stylelint-scss) |
stylelint-config-recommended if you only want to catch bugs.stylelint-config-standard if you’re writing plain CSS and want consistent style.stylelint-config-sass-guidelines (with stylelint-scss) if your project uses SCSS and you follow Sass architecture best practices.Don’t mix standard and sass-guidelines unless you’ve audited for rule conflicts. In most Sass projects, recommended + sass-guidelines gives you the cleanest, most targeted linting experience.
Choose stylelint-config-recommended when you only need to catch actual errors like invalid hex colors or unknown units, without enforcing any stylistic preferences. It's ideal for libraries, design systems, or teams that handle formatting separately (e.g., via Prettier) and want the lightest possible linting footprint.
Choose stylelint-config-sass-guidelines if your project uses SCSS and you follow the Sass Guidelines methodology, especially around nesting depth, variable naming, and mixin usage. Remember to install the stylelint-scss plugin, as this config relies on it for Sass-specific rule enforcement.
Choose stylelint-config-standard for plain CSS or PostCSS projects where you want both error prevention and consistent code style (like indentation, semicolons, and quote types) out of the box. It builds on recommended and provides a complete, opinionated setup without requiring additional plugins.
The recommended shareable config for Stylelint.
It turns on most of the Stylelint rules that help you avoid errors.
You can use this as a foundation for your own config, but we suggest most people use our standard config instead which extends this config and adds a few more rules to enforce common conventions.
npm install stylelint-config-recommended --save-dev
Set your stylelint config to:
{
"extends": "stylelint-config-recommended"
}
Add a "rules" key to your config, then add your overrides and additions there.
For example, to change the at-rule-no-unknown rule to use its ignoreAtRules option, turn off the block-no-empty rule, and add the unit-allowed-list rule:
{
"extends": "stylelint-config-recommended",
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["extends"]
}
],
"block-no-empty": null,
"unit-allowed-list": ["em", "rem", "s"]
}
}