stylelint-config-recommended vs stylelint-config-sass-guidelines vs stylelint-config-standard
CSS Linting Configuration Strategies with Stylelint
stylelint-config-recommendedstylelint-config-sass-guidelinesstylelint-config-standardSimilar Packages:

CSS Linting Configuration Strategies with Stylelint

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.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
stylelint-config-recommended03976.25 kB12 months agoMIT
stylelint-config-sass-guidelines044819.9 kB3a month agoMIT
stylelint-config-standard01,4189.22 kB32 months agoMIT

Stylelint Configuration Packages Compared: stylelint-config-recommended vs stylelint-config-standard vs stylelint-config-sass-guidelines

When 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.

🧱 Core Philosophy: What Each Config Enforces

stylelint-config-recommended

This 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-hex
  • function-calc-no-invalid
  • unit-no-unknown

But it does not include rules about spacing, ordering, or naming conventions.

stylelint-config-standard

This 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-semicolon
  • indentation
  • string-quotes
  • selector-list-comma-newline-after

This config assumes you’re writing standard CSS (or PostCSS-compatible syntax) and want predictable, readable output.

stylelint-config-sass-guidelines

This 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-selector

Note: This package depends on stylelint-scss plugin and won’t work properly without it.

🔌 Plugin Dependencies and Syntax Support

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"]
}

⚙️ Rule Overlap and Extensibility

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:

  • If you use both standard and sass-guidelines, you must manage potential rule conflicts manually.
  • A common pattern for SCSS projects is to combine 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]+)?$"
  }
}

🛠️ Real-World Usage Scenarios

Scenario 1: Plain CSS Project (e.g., legacy app or utility-first)

  • Best choice: stylelint-config-standard
  • Why? You get error prevention + consistent formatting without extra setup.

Scenario 2: Modern SCSS Codebase Following Sass Guidelines

  • Best choice: stylelint-config-sass-guidelines + stylelint-config-recommended
  • Why? You need Sass-aware linting, and recommended covers basic CSS validity.

Scenario 3: Minimal Linting (e.g., design system consumed by others)

  • Best choice: stylelint-config-recommended
  • Why? You only care about correctness, not style — consumers may have their own formatting rules.

⚠️ Important Notes on Maintenance

As of the latest verified documentation:

  • All three packages are actively maintained and compatible with Stylelint v15+.
  • None are deprecated.
  • stylelint-config-sass-guidelines explicitly states it’s intended for SCSS syntax only (not indented Sass).

📊 Summary Table

PackageError PreventionStylistic RulesSass SupportRequires Plugins
stylelint-config-recommended
stylelint-config-standard
stylelint-config-sass-guidelines⚠️ (partial)✅ (Sass-focused)✅ (stylelint-scss)

💡 Final Recommendation

  • Start with stylelint-config-recommended if you only want to catch bugs.
  • Upgrade to stylelint-config-standard if you’re writing plain CSS and want consistent style.
  • Use 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.

How to Choose: stylelint-config-recommended vs stylelint-config-sass-guidelines vs stylelint-config-standard

  • stylelint-config-recommended:

    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.

  • stylelint-config-sass-guidelines:

    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.

  • stylelint-config-standard:

    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.

README for stylelint-config-recommended

stylelint-config-recommended

NPM version Build Status

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.

Installation

npm install stylelint-config-recommended --save-dev

Usage

Set your stylelint config to:

{
  "extends": "stylelint-config-recommended"
}

Extending the config

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"]
  }
}

Changelog

License