Skip to content

Instantly share code, notes, and snippets.

@franzdumfart
Created May 12, 2017 12:15
Show Gist options
  • Save franzdumfart/4058e0f9a19f1b6a2dedc663b8ce3f10 to your computer and use it in GitHub Desktop.
Save franzdumfart/4058e0f9a19f1b6a2dedc663b8ce3f10 to your computer and use it in GitHub Desktop.
stylelint config inspired by the Airbnb css style-guide
{
"rules": {
"selector-no-id": true,
"indentation": 2,
"selector-list-comma-newline-after": "always",
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"block-opening-brace-space-before": "always",
"declaration-block-single-line-max-declarations": 1,
"rule-empty-line-before": ["always", {
"ignore": ["after-comment"]
}],
"comment-empty-line-before": ["always", {
"ignore": ["stylelint-commands"]
}],
"declaration-property-value-blacklist": {
"/^border/": ["none"]
},
"at-rule-blacklist": ["extend"],
"max-nesting-depth": 3,
"declaration-no-important": true,
"selector-max-compound-selectors": 3,
"selector-no-qualifying-type": true,
"no-duplicate-selectors": true,
"block-no-empty": true,
"at-rule-empty-line-before": [
"always", {
"ignoreAtRules": ["import", "first-nested"]
}
],
"at-rule-name-case": "lower",
"color-hex-case": "lower",
"color-hex-length": "long",
"color-no-invalid-hex": true,
"string-quotes": "single",
"value-no-vendor-prefix": true,
"value-list-comma-space-after": "always-single-line",
"shorthand-property-no-redundant-values": true,
"comment-whitespace-inside": "always",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"length-zero-no-unit": true,
"number-no-trailing-zeros": true,
"declaration-block-trailing-semicolon": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-semicolon-newline-after": "always",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-before": "always"
}
}
@arjunu
Copy link

arjunu commented Nov 9, 2017

Getting undefined rule selector-no-id for stylelint version 8.2.0. You can maybe replace it with "selector-max-id": 0 and "at-rule-blacklist": ["extend"] should be just "at-rule-blacklist": "extend".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment