Shareable stylelint config for CSS and SCSS, with a strict baseline
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.githooks
.github
src
.editorconfig
.eslintrc.js
.gitignore
.nvmrc
.travis.yml
CHANGELOG.md
LICENSE
README.md
commitlint.config.js
dangerfile.js
package-lock.json
package.json
prettier.config.js
release.config.js

README.md

@thibaudcolas/stylelint-config-cookbook npm Build Status

Shareable stylelint config for CSS and SCSS, with a strict baseline

Usage

Install stylelint and the config:

npm install --save-dev stylelint @thibaudcolas/stylelint-config-cookbook

Then configure stylelint to use this config. As a stylelint.config.js in the root of your project:

module.exports = {
  // https://github.com/thibaudcolas/stylelint-config-cookbook
  extends: "@thibaudcolas/stylelint-config-cookbook",
};

Related tools

To get the most out of this config, it is assumed that projects have the following tools set up:

Conventions

The overarching principle behind this config is to make it simpler to maintain stylesheets in large-scale projects. This means:

  • Support for large-scale CSS architectures like ITCSS.
  • Mandatory reusable values (via variables and functions) for properties that impact the overall consistency of the UI, e.g. colors and attributes of fonts.
  • A low maximum specificity, to prevent abuse of the CSS cascade (or altogether discourage usage of styles overrides beyond single components).
  • Blanket ban of CSS/SCSS features that make it harder to maintain stylesheets – id selectors (never), element selectors (max 1), nested properties, etc).

Rules

Cookbook config

Rules of stylelint-config-standard

Disabled rules