stylelint-config-standard, stylelint-config-sass-guidelines, and stylelint-config-recess-order are shareable configurations for Stylelint, a powerful CSS linter. stylelint-config-standard provides a baseline set of rules to avoid errors and enforce consistent syntax across standard CSS. stylelint-config-sass-guidelines extends this focus to Sass projects, enforcing best practices specific to preprocessors like variable usage and nesting depth. stylelint-config-recess-order prioritizes property ordering, ensuring CSS declarations follow a logical or alphabetical sequence for better readability.
When scaling CSS across a large team, consistency becomes just as important as functionality. stylelint-config-standard, stylelint-config-sass-guidelines, and stylelint-config-recess-order offer different approaches to enforcing this consistency. Each package targets a specific layer of CSS health — from syntax correctness to preprocessor architecture and property ordering. Let’s break down how they differ and where each fits in a modern workflow.
stylelint-config-standard focuses on correctness.
// .stylelintrc.json for standard
{
"extends": ["stylelint-config-standard"]
}
stylelint-config-sass-guidelines focuses on preprocessor architecture.
stylelint-scss plugin to parse Sass syntax.// .stylelintrc.json for sass-guidelines
{
"extends": ["stylelint-config-sass-guidelines"],
"plugins": ["stylelint-scss"]
}
stylelint-config-recess-order focuses on declaration order.
stylelint-order plugin to enforce sorting.// .stylelintrc.json for recess-order
{
"extends": ["stylelint-config-recess-order"],
"plugins": ["stylelint-order"]
}
Each config brings different dependencies. Knowing what you need to install prevents broken builds.
stylelint-config-standard is mostly standalone.
# Install for standard
npm install --save-dev stylelint stylelint-config-standard
stylelint-config-sass-guidelines requires SCSS parsing.
stylelint-scss to handle Sass syntax.# Install for sass-guidelines
npm install --save-dev stylelint stylelint-config-sass-guidelines stylelint-scss
stylelint-config-recess-order requires ordering logic.
stylelint-order to check property sequence.# Install for recess-order
npm install --save-dev stylelint stylelint-config-recess-order stylelint-order
The value of a linter lies in what it catches. Here is how each config handles common CSS issues.
stylelint-config-standard catches invalid values.
/* stylelint-config-standard flags this */
.element {
colr: red; /* Error: Unknown property */
margin: 10px 20px 30px 40px 50px; /* Error: Too many values */
}
stylelint-config-sass-guidelines catches architectural drift.
/* stylelint-config-sass-guidelines flags this */
.component {
.child {
.grandchild {
.great-grandchild { /* Error: Nesting depth exceeded */
color: #fff; /* Error: Color literal used */
}
}
}
}
stylelint-config-recess-order catches unordered properties.
display comes before position, etc./* stylelint-config-recess-order flags this */
.element {
color: red;
display: block; /* Error: Property order violation */
background: blue;
}
Running a linter alongside a code formatter like Prettier can cause conflicts. Each config handles this differently.
stylelint-config-standard often conflicts with Prettier.
stylelint-config-prettier to disable conflicting rules.// Common combo for standard
{
"extends": [
"stylelint-config-standard",
"stylelint-config-prettier"
]
}
stylelint-config-sass-guidelines has fewer conflicts.
// Common combo for sass-guidelines
{
"extends": [
"stylelint-config-sass-guidelines",
"stylelint-config-prettier"
]
}
stylelint-config-recess-order conflicts directly with Prettier.
// Warning: Do not combine with stylelint-config-prettier
{
"extends": ["stylelint-config-recess-order"]
}
| Feature | stylelint-config-standard | stylelint-config-sass-guidelines | stylelint-config-recess-order |
|---|---|---|---|
| Primary Goal | Syntax correctness | Sass architecture | Property ordering |
| Required Plugin | None (Core) | stylelint-scss | stylelint-order |
| Nesting Rules | No | Yes (Depth limits) | No |
| Property Order | No | No | Yes (Strict) |
| Prettier Friendly | ⚠️ (Needs extra config) | ✅ | ❌ (Conflict) |
Your choice depends on your stack and team priorities.
stylelint-config-standard is the safe default for most projects. It prevents errors without imposing strict style rules. Use this if you want reliability without friction.
stylelint-config-sass-guidelines is essential for Sass-heavy codebases. It enforces architectural rules that prevent spaghetti code in preprocessors. Use this if you rely on variables, mixins, and nesting.
stylelint-config-recess-order is for teams that value visual consistency above all. It removes debates about property order during code reviews. Use this if you want strict sorting and are willing to disable Prettier for CSS.
Final Thought: You can combine these configs if needed. For example, use stylelint-config-standard as a base, then add stylelint-config-recess-order for sorting. Just ensure your plugin dependencies are installed and conflicts are managed.
Choose stylelint-config-recess-order if property ordering is a priority for your team’s code review process. It forces declarations into a consistent sequence, reducing visual noise in style sheets. Select this when you want to automate sorting rather than debating it during pull requests.
Choose stylelint-config-sass-guidelines if your project relies heavily on Sass or SCSS. It enforces rules specific to preprocessors, such as nesting limits and variable patterns, which standard CSS configs ignore. This is the best fit for teams committed to Hugo Giraudel’s Sass architecture guidelines.
Choose stylelint-config-standard if you want a solid foundation for standard CSS projects without extra opinions on property order. It catches syntax errors and impossible values, making it ideal for teams that need reliability without strict formatting rules. Use this as a base if you plan to layer other configs on top.
A Stylelint config that sorts CSS properties the way Recess did and Bootstrap did/does.
*With some modifications & additions for modern properties.
npm install --save-dev stylelint stylelint-order stylelint-config-recess-order
module.exports = {
extends: ['stylelint-config-recess-order'],
rules: {
// Add overrides and additional rules here
},
}
The default setup applies only the 'order/properties-order' rule with the
various property groups. If you need to configure other options for this rule,
the groups can be imported separately and the rule configured to your needs.
const propertyGroups = require('stylelint-config-recess-order/groups')
module.exports = {
extends: [], // Do not extend the config here.
rules: {
// Configure the rule manually.
'order/properties-order': propertyGroups.map((group) => ({
...group,
emptyLineBefore: 'always',
noEmptyLineBetween: true,
})),
},
}