Course contentsShow
← Web Development
Lesson 1438 of 2,98226. Code Quality ToolsFree lesson

Standard and Recommended Configs

Using stylelint-config-standard and stylelint-config-recommended as starting points for rule sets.

Standard and Recommended Configs

What you'll learn: How to leverage stylelint-config-standard and stylelint-config-recommended as ready-made rule foundations instead of configuring every rule from scratch.

The Problem with Starting from Zero

When you install Stylelint, it comes with no rules enabled by default. You could manually configure dozens of rules one by one, but that's tedious and you might miss important patterns. This is where shareable configs become invaluable.

Two Foundation Configs

stylelint-config-recommended contains rules that catch actual errors in your CSS—things like invalid syntax, duplicate properties, or unknown units. Think of it as the "correctness" baseline.

stylelint-config-standard extends the recommended config and adds stylistic rules based on common CSS conventions—things like lowercase property names, single quotes, and consistent indentation patterns. It's the "recommended + style guide" package.

Using Them in Your Config

After installing these packages, you extend them in your .stylelintrc.json:

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

Since standard extends recommended internally, you get both error-checking and style enforcement. You can then override specific rules:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "indentation": 4,
    "color-hex-length": "long"
  }
}

Which One Should You Choose?

Start with recommended if you only want error prevention and plan to define your own style rules. Choose standard if you want a complete, opinionated starting point that enforces widespread CSS conventions.

Key Takeaway: stylelint-config-recommended and stylelint-config-standard provide battle-tested rule sets so you don't start from scratch—extend them, then customize only what your team needs differently.