1.0.0 • Published 7 years ago

stylelint-config-minerva v1.0.0

Weekly downloads
2
License
ISC
Repository
-
Last release
7 years ago

stylelint-config-minerva

Minerva's stylelint config

Installation

yarn add --dev stylelint-config-minerva
# or
npm install stylelint-config-minerva --save-dev

It is derived from the common rules found within a handful of CSS styleguides, including: The Idiomatic CSS Principles, GitHub's PrimerCSS Guidelines, Google's CSS Style Guide, Airbnb's Styleguide, and @mdo's Code Guide.

It favours flexibility over strictness for things like multi-line lists and single-line rulesets, and tries to avoid potentially divisive rules.

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

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

Usage

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

Extending the config

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

For example, to change the indentation to tabs, turn off the number-leading-zero rule, change the property-no-unknown rule to use its ignoreAtRules option and add the unit-whitelist rule:

{
  "extends": "stylelint-config-minerva",
  "rules": {
    "indentation": "tab",
    "number-leading-zero": null,
    "property-no-unknown": [ true, {
      "ignoreProperties": [
        "composes"
      ]
    }],
    "unit-whitelist": ["em", "rem", "s"]
  }
}

NOTE The whole reason this config was written was so that we would never need to overwrite any rules. If you find that you dislike a rule and would like to change it, please bring it up with the Minerva Engineering team.

Suggested additions

stylelint-config-minerva is a great foundation for your own config. You can extend it create a tailored and much stricter config: