UNPKG

11.3 kBMarkdownView Raw
1# stylelint-config-sass-guidelines
2
3[![Greenkeeper badge](https://badges.greenkeeper.io/bjankord/stylelint-config-sass-guidelines.svg)](https://greenkeeper.io/)
4[![NPM version](http://img.shields.io/npm/v/stylelint-config-sass-guidelines.svg)](https://www.npmjs.org/package/stylelint-config-sass-guidelines) [![Build Status](https://travis-ci.org/bjankord/stylelint-config-sass-guidelines.svg?branch=master)](https://travis-ci.org/bjankord/stylelint-config-sass-guidelines)
5
6> Sass Guidelines shareable config for stylelint.
7
8A stylelint config based on [sass-guidelin.es](https://sass-guidelin.es/)
9
10## Installation
11
12```console
13$ npm install --save stylelint-config-sass-guidelines
14```
15
16## Usage
17
18Set your stylelint config to:
19
20```json
21{
22 "extends": "stylelint-config-sass-guidelines"
23}
24```
25
26### Extending the config
27
28Simply add a `"rules"` key to your config and add your overrides there.
29
30For example, to change the `indentation` to tabs and turn off the `number-leading-zero` rule:
31
32
33```json
34{
35 "extends": "stylelint-config-sass-guidelines",
36 "rules": {
37 "indentation": "tab",
38 "number-leading-zero": null
39 }
40}
41```
42
43## [Lint Rule Comparison](https://github.com/bjankord/stylelint-config-sass-guidelines/wiki/Lint-Rule-Comparison)
44
45## [Lint Report Comparison](https://github.com/bjankord/stylelint-config-sass-guidelines/wiki/Lint-Report-Comparison)
46
47## Documentation
48
49### Plugins
50
51* [`stylelint-order`](https://github.com/hudochenkov/stylelint-order): A plugin pack of order related linting rules for stylelint.
52* [`stylelint-scss`](https://github.com/kristerkari/stylelint-scss): A collection of SCSS specific linting rules for stylelint
53
54### Configured lints
55
56This is a list of the lints turned on in this configuration, and what they do.
57
58#### At-rule
59
60* [`at-rule-blacklist`](http://stylelint.io/user-guide/rules/at-rule-blacklist/): Specify a blacklist of disallowed at-rules.
61 * `"debug"` Disallow the use of `@debug`.
62* [`at-rule-no-vendor-prefix`](http://stylelint.io/user-guide/rules/at-rule-no-vendor-prefix/): Disallow vendor prefixes for at-rules.
63
64#### Block
65
66* [`block-no-empty`](http://stylelint.io/user-guide/rules/block-no-empty/): Disallow empty blocks.
67* [`block-opening-brace-space-before`](http://stylelint.io/user-guide/rules/block-opening-brace-space-before/): There must always be a single space before the opening brace.
68
69#### Color
70
71* [`color-hex-case`](http://stylelint.io/user-guide/rules/color-hex-case/): Hex colors must be written in lowercase.
72* [`color-hex-length`](http://stylelint.io/user-guide/rules/color-hex-length/): Always use short hex notation, where available.
73* [`color-named`](http://stylelint.io/user-guide/rules/color-named/): Colors must never be named.
74* [`color-no-invalid-hex`](http://stylelint.io/user-guide/rules/color-no-invalid-hex/): Hex values must be valid.
75
76#### Declaration
77
78* [`declaration-bang-space-after`](http://stylelint.io/user-guide/rules/declaration-bang-space-after/): There must never be whitespace after the bang.
79* [`declaration-bang-space-before`](http://stylelint.io/user-guide/rules/declaration-bang-space-before/): There must always be a single space before the bang.
80* [`declaration-colon-space-after`](http://stylelint.io/user-guide/rules/declaration-colon-space-after/): There must always be a single space after the colon if the declaration's value is single-line.
81* [`declaration-colon-space-before`](http://stylelint.io/user-guide/rules/declaration-colon-space-before/): There must never be whitespace before the colon.
82
83#### Declaration block
84
85* [`declaration-block-properties-order`](http://stylelint.io/user-guide/rules/declaration-block-properties-order/): Properties in declaration blocks must be sorted alphabetically.
86* [`declaration-block-semicolon-newline-after`](http://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-after/): There must always be a newline after the semicolon.
87* [`declaration-block-semicolon-space-before`](http://stylelint.io/user-guide/rules/declaration-block-semicolon-space-before/): There must never be whitespace before the semicolons.
88* [`declaration-block-single-line-max-declarations`](http://stylelint.io/user-guide/rules/declaration-block-single-line-max-declarations/): There should never be more than `1` declaration per line.
89* [`declaration-block-trailing-semicolon`](http://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon/): There must always be a trailing semicolon.
90
91#### Declaration Property
92
93* [`declaration-property-value-blacklist`](http://stylelint.io/user-guide/rules/declaration-property-value-blacklist/): Specify a blacklist of disallowed property and value pairs within declarations.
94 * `^border`: Disallow the use of the word `none` for borders, use `0` instead.
95
96#### Function
97
98* [`function-comma-space-after`](http://stylelint.io/user-guide/rules/function-comma-space-after/): There must always be a single space after the commas in single-line functions.
99* [`function-parentheses-space-inside`](http://stylelint.io/user-guide/rules/function-parentheses-space-inside/): There must never be whitespace on the inside of the parentheses of functions.
100* [`function-url-quotes`](http://stylelint.io/user-guide/rules/function-url-quotes/): URLs must always be quoted.
101
102#### General
103
104* [`indentation`](http://stylelint.io/user-guide/rules/indentation/): Indentation should always be `2` spaces.
105* [`length-zero-no-unit`](http://stylelint.io/user-guide/rules/length-zero-no-unit/): Disallow units for zero lengths.
106* [`max-nesting-depth`](http://stylelint.io/user-guide/rules/max-nesting-depth/): Limit the allowed nesting depth to `1`.
107* [`no-missing-eof-newline`](http://stylelint.io/user-guide/rules/no-missing-eof-newline/): Disallow missing end-of-file newlines in non-empty files.
108
109#### Media Feature
110
111* [`media-feature-name-no-vendor-prefix`](http://stylelint.io/user-guide/rules/media-feature-name-no-vendor-prefix/): Disallow vendor prefixes for media feature names.
112
113#### Number
114
115* [`number-leading-zero`](http://stylelint.io/user-guide/rules/number-leading-zero/): There must always be a leading zero.
116* [`number-no-trailing-zeros`](http://stylelint.io/user-guide/rules/number-no-trailing-zeros/): Disallow trailing zeros in numbers.
117
118#### Property
119
120* [`property-no-vendor-prefix`](http://stylelint.io/user-guide/rules/property-no-vendor-prefix/): Disallow vendor prefixes for properties.
121* [`shorthand-property-no-redundant-values`](http://stylelint.io/user-guide/rules/shorthand-property-no-redundant-values/): Disallow redundant values in shorthand properties.
122
123
124#### Rule
125
126* [`rule-nested-empty-line-before`](http://stylelint.io/user-guide/rules/rule-nested-empty-line-before/): There must always be an empty line before multi-line rules. _Except_: Nested rules that are the first of their parent rule. _Ignore_: Rules that come after a comment.
127* [`rule-non-nested-empty-line-before`](http://stylelint.io/user-guide/rules/rule-non-nested-empty-line-before/): There must always be an empty line before multi-line rules. _Ignore_: Rules that come after a comment.
128
129#### SCSS
130* [`at-extend-no-missing-placeholder`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/at-extend-no-missing-placeholder/README.md): Disallow at-extends (`@extend`) with missing placeholders.
131* [`at-function-pattern`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/at-function-pattern/README.md): SCSS functions must be written in lowercase and match the regex `^[a-z]+([a-z0-9-]+[a-z0-9]+)?$`.
132* [`at-import-no-partial-leading-underscore`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/at-import-no-partial-leading-underscore/README.md): Disallow leading underscore in partial names in `@import`.
133* [`at-import-partial-extension-blacklist`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/at-import-partial-extension-blacklist/README.md): Specify blacklist of disallowed file extensions for partial names in `@import` commands.
134 * `.scss`: Disallow the use of the `.scss` file extension in imports.
135* [`at-mixin-pattern`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/at-mixin-pattern/README.md): SCSS mixins must be written in lowercase and match the regex `^[a-z]+([a-z0-9-]+[a-z0-9]+)?$`.
136* [`dollar-variable-colon-space-after`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/dollar-variable-colon-space-after/README.md): Require a single space after the colon in $-variable declarations.
137* [`dollar-variable-colon-space-before`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/dollar-variable-colon-space-before/README.md): Disallow whitespace before the colon in $-variable declarations.
138* [`dollar-variable-pattern`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/dollar-variable-pattern/README.md): SCSS variables must be written in lowercase and match the regex `^[a-z]+([a-z0-9-]+[a-z0-9]+)?$`.
139* [`percent-placeholder-pattern`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/percent-placeholder-pattern/README.md): SCSS `%`-placeholders must be written in lowercase and match the regex `^[a-z]+([a-z0-9-]+[a-z0-9]+)?$`.
140* [`selector-no-redundant-nesting-selector`](https://github.com/kristerkari/stylelint-scss/blob/master/src/rules/selector-no-redundant-nesting-selector/README.md): Disallow redundant nesting selectors (`&`).
141
142#### Selector
143
144* [`selector-class-pattern`](http://stylelint.io/user-guide/rules/selector-class-pattern/): Selectors must be written in lowercase and match the regex `^(?:u|is|has)-[a-z][a-zA-Z0-9]*$|^(?!u|is|has)[a-zA-Z][a-zA-Z0-9]*(?:-[a-z][a-zA-Z0-9]*)?(?:--[a-z][a-zA-Z0-9]*)?$`.
145* [`selector-list-comma-newline-after`](http://stylelint.io/user-guide/rules/selector-list-comma-newline-after/): There must always be a newline after the commas of selector lists.
146* [`selector-max-compound-selectors`](http://stylelint.io/user-guide/rules/selector-max-compound-selectors/): Limit the number of compound selectors in a selector to `3`.
147* [`selector-no-id`](http://stylelint.io/user-guide/rules/selector-no-id/): Disallow id selectors.
148* [`selector-no-qualifying-type`](http://stylelint.io/user-guide/rules/selector-no-qualifying-type/): Disallow qualifying a selector by type.
149* [`selector-no-vendor-prefix`](http://stylelint.io/user-guide/rules/selector-no-vendor-prefix/): Disallow vendor prefixes for selectors.
150* [`selector-pseudo-element-colon-notation`](http://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation/): Applicable pseudo-elements must always use the double colon notation.
151* [`selector-pseudo-element-no-unknown`](http://stylelint.io/user-guide/rules/selector-pseudo-element-no-unknown/): Disallow unknown pseudo-element selectors.
152
153#### String
154
155* [`string-quotes`](http://stylelint.io/user-guide/rules/string-quotes/): Strings must always be wrapped with single quotes.
156
157#### Stylelint Disable Comment
158
159* [`stylelint-disable-reason`](http://stylelint.io/user-guide/rules/stylelint-disable-reason/): Require a reason comment before stylelint-disable comments.
160
161#### Value
162
163* [`value-no-vendor-prefix`](http://stylelint.io/user-guide/rules/value-no-vendor-prefix/): Disallow vendor prefixes for values.
164
165## [Changelog](CHANGELOG.md)
166
167## [License](LICENSE)