stylelint-config-minerva v1.0.0
stylelint-config-minerva
Minerva's stylelint config
Installation
yarn add --dev stylelint-config-minerva
# or
npm install stylelint-config-minerva --save-devIt 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:
- Specify what quotes must be used using:
- If you use
autoprefixeryou'll want to disallow vendor prefixes using: - Control specificity using:
- Specify acceptable selector types, units, properties, functions and words in comments using:
at-rule-blacklistat-rule-no-unknownat-rule-whitelistcolor-namedcolor-no-hexcomment-word-blacklistdeclaration-no-importantdeclaration-property-unit-blacklistdeclaration-property-unit-whitelistdeclaration-property-value-blacklistdeclaration-property-value-whitelistfunction-blacklistfunction-url-scheme-whitelistfunction-whitelistmedia-feature-name-blacklistmedia-feature-name-whitelistproperty-blacklistproperty-whitelistselector-attribute-operator-blacklistselector-attribute-operator-whitelistselector-no-attributeselector-no-combinatorselector-no-idselector-no-qualifying-typeselector-no-typeselector-no-universalselector-pseudo-class-blacklistselector-pseudo-class-whitelistunit-blacklistunit-whitelist
- Specify acceptable naming patterns using:
- Specify a notation when there are one or more valid representations using:
- Specify what types of URLs are allowed using:
- Specify a maximum line length using:
8 years ago