Skip to content

Instantly share code, notes, and snippets.

@rossmc
Last active February 6, 2021 12:56
Show Gist options
  • Save rossmc/d318212e79ccbebc9852e09a7c970d92 to your computer and use it in GitHub Desktop.
Save rossmc/d318212e79ccbebc9852e09a7c970d92 to your computer and use it in GitHub Desktop.
Stylelint configuration object for Magento 2 Projects based on their coding standards http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-less.html
{
"rules": {
"indentation": 4,
"block-opening-brace-space-before": "always",
"block-opening-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"selector-list-comma-newline-after": "always",
"string-quotes": "single",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"declaration-block-semicolon-newline-after": "always",
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"rule-empty-line-before": [ "always", {
"except": ["first-nested"],
"ignore": ["after-comment"]
} ],
"declaration-block-trailing-semicolon":"always",
"no-extra-semicolons": true,
"declaration-block-semicolon-space-before": "never",
"declaration-no-important": true,
"comment-empty-line-before": "always",
"comment-whitespace-inside": "always",
"comment-no-empty": true,
"selector-max-id": 0,
"selector-class-pattern": "^_?[a-z0-9]+(-[a-z0-9]+)*$",
"selector-type-case": "lower",
"max-nesting-depth": 3,
"length-zero-no-unit": true,
"number-leading-zero": "never",
"unit-case": "lower",
"color-hex-case": "lower",
"color-no-invalid-hex": true,
"color-hex-length": "short",
"block-no-empty": true,
"max-empty-lines": 2,
"unit-whitelist": ["px", "rem", "%", "s", "fr"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment