stylelint-config-recommended vs stylelint-config-standard vs stylelint-config-recommended-scss vs stylelint-config-sass-guidelines vs stylelint-config-idiomatic-order
CSS Linting and Style Guides
stylelint-config-recommendedstylelint-config-standardstylelint-config-recommended-scssstylelint-config-sass-guidelinesstylelint-config-idiomatic-orderSimilar Packages:
CSS Linting and Style Guides

CSS Linting and Style Guides are essential tools in web development that help maintain consistent and high-quality stylesheets. They enforce coding standards, catch errors, and promote best practices in CSS writing. This is crucial for collaborative projects where multiple developers contribute to the same codebase. Linting tools analyze the CSS code for potential issues, while style guide configurations provide predefined rules and guidelines for writing CSS. These tools help improve code readability, reduce bugs, and ensure a cohesive design across the application. Popular linting tools include Stylelint, ESLint (for JavaScript), and Prettier (for code formatting).

Npm Package Weekly Downloads Trend
3 Years
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
stylelint-config-recommended6,259,2463976.25 kB1a month agoMIT
stylelint-config-standard4,821,2031,4179.22 kB3a month agoMIT
stylelint-config-recommended-scss2,792,5922376.45 kB19a month agoMIT
stylelint-config-sass-guidelines401,75544819.9 kB115 days agoMIT
stylelint-config-idiomatic-order158,286185390 kB132 years agoMIT
Feature Comparison: stylelint-config-recommended vs stylelint-config-standard vs stylelint-config-recommended-scss vs stylelint-config-sass-guidelines vs stylelint-config-idiomatic-order

Linting Scope

  • stylelint-config-recommended:

    Covers a broad range of common CSS issues, including syntax errors, invalid properties, and best practices.

  • stylelint-config-standard:

    Provides a wide-ranging set of rules for general CSS linting, addressing both syntax and best practices.

  • stylelint-config-recommended-scss:

    Targets SCSS-specific issues, including nested rules, mixins, and SCSS syntax errors.

  • stylelint-config-sass-guidelines:

    Aligns with Sass community guidelines, focusing on best practices and common pitfalls in Sass development.

  • stylelint-config-idiomatic-order:

    Focuses on the order of CSS properties within rules, promoting an idiomatic and consistent structure.

Customization

  • stylelint-config-recommended:

    Offers a solid base with some flexibility for customization, allowing teams to adjust rules as needed.

  • stylelint-config-standard:

    Highly customizable, enabling teams to modify rules while maintaining a comprehensive linting framework.

  • stylelint-config-recommended-scss:

    Provides SCSS-specific rules with room for customization, particularly for teams that want to extend SCSS linting.

  • stylelint-config-sass-guidelines:

    Follows established guidelines but allows for customization to fit team preferences and project needs.

  • stylelint-config-idiomatic-order:

    Allows for customization of property order, but primarily focuses on enforcing a specific ordering methodology.

Ease of Integration

  • stylelint-config-recommended:

    Seamless integration with Stylelint, making it a go-to choice for many projects.

  • stylelint-config-standard:

    Widely used and well-documented, ensuring easy integration into various workflows.

  • stylelint-config-recommended-scss:

    Designed for quick integration into SCSS projects, ensuring immediate linting of SCSS files.

  • stylelint-config-sass-guidelines:

    Simple integration for teams adopting Sass guidelines, promoting consistency from the start.

  • stylelint-config-idiomatic-order:

    Easy to integrate into existing projects, especially those already using Stylelint.

Community Support

  • stylelint-config-recommended:

    Part of the larger Stylelint ecosystem, benefiting from strong community support and ongoing development.

  • stylelint-config-standard:

    One of the most popular configurations, with extensive community support and contributions.

  • stylelint-config-recommended-scss:

    Supported by the SCSS community, providing resources and updates for SCSS-specific linting.

  • stylelint-config-sass-guidelines:

    Aligns with the Sass community, which actively promotes and supports these guidelines.

  • stylelint-config-idiomatic-order:

    Backed by a community that values idiomatic CSS practices, though smaller than some other configurations.

Code Examples

  • stylelint-config-recommended:

    Example of stylelint-config-recommended catching an error:

    .button {
      color: blue;
      background-colour: white; /* This will trigger a linting error */
    }
    
  • stylelint-config-standard:

    Example of stylelint-config-standard:

    .button {
      color: blue;
      background-color: white;
      margin: 10px;
      padding: 5px;
      /* This will catch common linting issues */
    }
    
  • stylelint-config-recommended-scss:

    Example of stylelint-config-recommended-scss for SCSS:

    .button {
      color: blue;
      background-color: white;
      @include mixin(); /* SCSS-specific linting */
    }
    
  • stylelint-config-sass-guidelines:

    Example of stylelint-config-sass-guidelines:

    .button {
      color: blue;
      background-color: white;
      @include mixin();
      /* Follow Sass guidelines for nesting and mixins */
    }
    
  • stylelint-config-idiomatic-order:

    Example of stylelint-config-idiomatic-order in action:

    /* stylelint-disable property-no-unknown */
    .button {
      color: blue;
      background-color: white;
      margin: 10px;
      padding: 5px;
    }
    
How to Choose: stylelint-config-recommended vs stylelint-config-standard vs stylelint-config-recommended-scss vs stylelint-config-sass-guidelines vs stylelint-config-idiomatic-order
  • stylelint-config-recommended:

    Select stylelint-config-recommended for a solid foundation of linting rules that cover common issues in CSS. This package is suitable for projects of all sizes and helps catch errors and enforce best practices without being overly restrictive.

  • stylelint-config-standard:

    Select stylelint-config-standard for a comprehensive set of rules that cover a wide range of CSS linting issues. This package is suitable for projects that require a balanced approach to linting, catching both common errors and encouraging best practices without being too opinionated.

  • stylelint-config-recommended-scss:

    Opt for stylelint-config-recommended-scss if you are working with SCSS (Sass) and need a configuration that addresses SCSS-specific syntax and features. This is essential for projects that heavily utilize SCSS and want to ensure proper linting for nested rules, mixins, and other SCSS constructs.

  • stylelint-config-sass-guidelines:

    Choose stylelint-config-sass-guidelines if you want to follow the guidelines set by the Sass community. This configuration is great for teams that want to adhere to established best practices in Sass development, ensuring clean and maintainable code.

  • stylelint-config-idiomatic-order:

    Choose stylelint-config-idiomatic-order if you want to enforce an idiomatic order for your CSS properties, promoting readability and consistency in your stylesheets. This configuration is ideal for teams that value a clear and logical structure in their CSS code.

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