diff --git a/.stylelintrc b/.stylelintrc index 98d85ba..9fe69f1 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -4,33 +4,52 @@ "stylelint-scss" ], "rules": { - "at-rule-empty-line-before": [ "always", { - except: [ "blockless-group", "first-nested" ], - ignore: ["after-comment"] - } ], + "at-rule-empty-line-before": [ + "always", + { + "except": [ + "blockless-group", + "first-nested" + ], + "ignore": [ + "after-comment" + ] + } + ], "at-rule-name-case": "lower", "at-rule-semicolon-newline-after": "always", "block-closing-brace-newline-after": "always", - "block-closing-brace-newline-before": "always", + "block-closing-brace-newline-before": "always-multi-line", "block-no-empty": true, - "block-no-single-line": true, "block-opening-brace-newline-after": "always-multi-line", "block-opening-brace-space-before": "always", "color-hex-case": "lower", "color-hex-length": "short", "color-no-invalid-hex": true, - "comment-empty-line-before": [ "always", { - except: ["first-nested"], - ignore: ["stylelint-commands"] - } ], + "comment-empty-line-before": [ + "always", + { + "except": [ + "first-nested" + ], + "ignore": [ + "stylelint-commands" + ] + } + ], "comment-no-empty": true, "comment-whitespace-inside": "always", "custom-property-no-outside-root": true, "declaration-bang-space-after": "never", "declaration-bang-space-before": "always", - "declaration-block-no-duplicate-properties": [ true, { - ignore: ["consecutive-duplicates"] - } ], + "declaration-block-no-duplicate-properties": [ + true, + { + "ignore": [ + "consecutive-duplicates" + ] + } + ], "declaration-block-no-ignored-properties": true, "declaration-block-no-redundant-longhand-properties": true, "declaration-block-no-shorthand-property-overrides": true, @@ -54,15 +73,25 @@ "function-parentheses-space-inside": "never-single-line", "function-url-quotes": "always", "function-whitespace-after": "always", - "indentation": [2, { - ignore: ["value"] - }], + "indentation": [ + 2, + { + "ignore": [ + "value" + ] + } + ], "keyframe-declaration-no-important": true, "length-zero-no-unit": true, "max-empty-lines": 1, - "max-nesting-depth": [2, { - ignore: ["at-rules-without-declaration-blocks"], - }], + "max-nesting-depth": [ + 2, + { + "ignore": [ + "at-rules-without-declaration-blocks" + ] + } + ], "media-feature-colon-space-after": "always", "media-feature-colon-space-before": "never", "media-feature-name-case": "lower", @@ -80,19 +109,24 @@ "no-missing-end-of-source-newline": true, "number-leading-zero": "always", "number-no-trailing-zeros": true, - "plugin/selector-bem-pattern": { + "plugin\/selector-bem-pattern": { "preset": "bem" }, "property-case": "lower", "property-no-unknown": true, - "rule-non-nested-empty-line-before": [ "always-multi-line", { - ignore: ["after-comment"] - } ], - "scss/at-extend-no-missing-placeholder": true, - "scss/at-import-no-partial-leading-underscore": true, - "scss/at-mixin-argumentless-call-parentheses": always, - "scss/dollar-variable-colon-space-before": "never", - "scss/selector-no-redundant-nesting-selector": true, + "rule-non-nested-empty-line-before": [ + "always-multi-line", + { + "ignore": [ + "after-comment" + ] + } + ], + "scss\/at-extend-no-missing-placeholder": true, + "scss\/at-import-no-partial-leading-underscore": true, + "scss\/at-mixin-argumentless-call-parentheses": "always", + "scss\/dollar-variable-colon-space-before": "never", + "scss\/selector-no-redundant-nesting-selector": true, "selector-attribute-brackets-space-inside": "never", "selector-attribute-operator-space-after": "never", "selector-attribute-operator-space-before": "never", @@ -119,12 +153,20 @@ "time-no-imperceptible": true, "unit-case": "lower", "unit-no-unknown": true, - "value-keyword-case": [ "lower", { - ignoreKeywords: ["Sky", "Text", "Helvetica", "Arial"] - }], + "value-keyword-case": [ + "lower", + { + "ignoreKeywords": [ + "Sky", + "Text", + "Helvetica", + "Arial" + ] + } + ], "value-list-comma-newline-after": "always-multi-line", "value-list-comma-newline-before": "never-multi-line", "value-list-comma-space-before": "never", - "value-list-max-empty-lines": 0, + "value-list-max-empty-lines": 0 } } diff --git a/README.md b/README.md index d64ef9f..38c680e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ > Believe in Better CSS +An Evolving CSS / Sass Style Guide for Sky + ## Contents ### Writing CSS / Sass @@ -77,7 +79,7 @@ It's important we keep code transparent and self-documented when it comes to nam * **Don't** use `html` tags in selectors. * **Don't** use IDs (`#`) in selectors. -* **Don't** unncessarily nest selectors. +* **Don't** unnecessarily nest selectors. * Try to keep selectors flat, at the same level of specificity. * Avoid going more than 2 levels deep. @@ -173,7 +175,7 @@ In your stylesheet this would look like: } ``` -Avoid using the SCSS ampersand shortcut (`&__`) when defining elements, it'll make searching your codebase a lot less productive. +Avoid using the SCSS ampersand shortcut (`&--`) when defining elements, it'll make searching your codebase a lot less productive. For more detail on BEM modifiers, visit [bem.info](https://en.bem.info/methodology/quick-start/#modifier). diff --git a/package.json b/package.json index 76e41c4..e755eb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sky-css-lint", - "version": "0.2.0", + "version": "1.0.0", "description": "Sky's CSS Style Guide", "main": "index.js", "scripts": {