stylelint-config-standard vs stylelint-config-sass-guidelines vs stylelint-config-recess-order
Stylelint Configuration Packages Comparison
1 Year
stylelint-config-standardstylelint-config-sass-guidelinesstylelint-config-recess-orderSimilar Packages:
What's Stylelint Configuration Packages?

Stylelint configuration packages provide predefined rules and guidelines for linting CSS and preprocessors like SASS. They help maintain code quality, consistency, and adherence to best practices in styling, making it easier for developers to enforce coding standards across their projects. These configurations can be tailored to specific needs, ensuring that stylesheets remain clean, maintainable, and free of common errors.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
stylelint-config-standard3,430,3801,4028.79 kB22 months agoMIT
stylelint-config-sass-guidelines336,27444619.9 kB56 months agoMIT
stylelint-config-recess-order298,30135422.6 kB7a month agoISC
Feature Comparison: stylelint-config-standard vs stylelint-config-sass-guidelines vs stylelint-config-recess-order

Linting Rules

  • stylelint-config-standard:

    Offers a broad set of linting rules that cover general CSS practices, including property ordering, color usage, and syntax errors. It serves as a solid baseline for CSS projects, ensuring adherence to common standards.

  • stylelint-config-sass-guidelines:

    This configuration includes rules tailored for SASS, addressing specific issues that can arise when using the preprocessor. It promotes best practices such as nesting limits, variable usage, and mixin definitions, ensuring that SASS code remains clean and efficient.

  • stylelint-config-recess-order:

    This package provides a set of rules focused on the ordering of CSS properties, which helps maintain a logical structure in stylesheets. It encourages developers to group properties in a consistent manner, improving readability and maintainability.

Customization

  • stylelint-config-standard:

    Highly customizable, this package allows developers to add or override rules based on project requirements, making it suitable for various types of projects.

  • stylelint-config-sass-guidelines:

    This configuration can be extended or modified to include additional rules that suit your project’s needs, allowing for flexibility while still adhering to established SASS best practices.

  • stylelint-config-recess-order:

    While it enforces a specific order, this package allows for some customization in terms of property groups, enabling teams to adapt the rules to fit their specific coding style and preferences.

Community Support

  • stylelint-config-standard:

    As one of the most popular Stylelint configurations, it enjoys strong community support, with frequent updates and a wealth of resources available for troubleshooting and best practices.

  • stylelint-config-sass-guidelines:

    Backed by the SASS community, this configuration is regularly updated to reflect the latest best practices and guidelines, ensuring that users have access to current standards.

  • stylelint-config-recess-order:

    This package is widely recognized within the CSS community, benefiting from community contributions and updates that keep it aligned with best practices in CSS property ordering.

Ease of Use

  • stylelint-config-standard:

    Known for its simplicity, this package can be quickly set up and used, making it an excellent choice for developers looking for a hassle-free linting experience.

  • stylelint-config-sass-guidelines:

    This configuration is user-friendly for SASS developers, providing clear guidelines that are easy to implement and follow, making it accessible even for those new to SASS.

  • stylelint-config-recess-order:

    Designed to be straightforward, this package is easy to integrate into existing projects, requiring minimal setup to start enforcing property order rules.

Performance Impact

  • stylelint-config-standard:

    Offers a balanced approach with a comprehensive set of rules, ensuring that linting remains efficient without compromising on the thoroughness of checks.

  • stylelint-config-sass-guidelines:

    This configuration may introduce slight overhead due to SASS-specific rules, but it remains efficient and does not significantly hinder the linting process.

  • stylelint-config-recess-order:

    The performance impact is minimal, as it primarily focuses on property ordering without extensive checks, allowing for quick linting processes.

How to Choose: stylelint-config-standard vs stylelint-config-sass-guidelines vs stylelint-config-recess-order
  • stylelint-config-standard:

    Select this package for a comprehensive set of standard rules that cover a wide range of CSS properties and practices. It is ideal for projects that require a solid foundation of linting rules without the need for specific methodologies or frameworks.

  • stylelint-config-sass-guidelines:

    Opt for this configuration if you are working with SASS and want to adhere to the SASS Guidelines. It includes rules that promote best practices specific to SASS, helping to prevent common pitfalls and ensuring that your SASS code is clean and maintainable.

  • stylelint-config-recess-order:

    Choose this package if you want to enforce a specific order for CSS properties based on the Recess methodology, which promotes a consistent structure in your stylesheets. It is particularly useful for teams that prioritize organization and readability in their CSS.

README for stylelint-config-standard

stylelint-config-standard

NPM version Build Status

The standard shareable config for Stylelint.

It extends stylelint-config-recommended and turns on additional rules to enforce modern conventions found in the CSS specifications and within Baseline Widely Available.

To see the rules that this config uses, please read the config itself.

Example

@import url("foo.css");
@import url("bar.css");

@custom-media --foo (min-width: 30em);

/**
 * Multi-line comment
 */

:root {
  --brand-red: hsl(5deg 10% 40%);
}

/* Single-line comment */

.class-foo:not(a, div) {
  margin: 0;
  top: calc(100% - 2rem);
}

/* Flush single line comment */
@media (width >= 60em) {
  #id-bar {
    /* Flush to parent comment */
    --offset: 0px;

    color: #fff;
    font-family: Helvetica, "Arial Black", sans-serif;
    left: calc(var(--offset) + 50%);
  }

  /* Flush nested single line comment */
  a::after {
    display: block;
    content: "→";
    background-image: url("x.svg");
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

Note: the config is tested against this example, as such the example contains plenty of CSS syntax and features.

Installation

npm install stylelint-config-standard --save-dev

Usage

Set your Stylelint config to:

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

Extending the config

Add a "rules" key to your config, then add your overrides and additions there.

You can turn off rules by setting its value to null. For example:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "selector-class-pattern": null
  }
}

Or lower the severity of a rule to a warning using the severity secondary option. For example:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "property-no-vendor-prefix": [
      true,
      {
        "severity": "warning"
      }
    ]
  }
}

Or to add a rule, For example, the unit-allowed-list one:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "unit-allowed-list": ["em", "rem", "s"]
  }
}

We recommend adding more of Stylelint's rules to your config as these rules need to be configured to suit your specific needs.

Changelog

License