stylelint-scss
Version:
A collection of SCSS specific rules for stylelint
132 lines (103 loc) • 2.5 kB
Markdown
# at-else-closing-brace-space-after
Require a single space or disallow whitespace after the closing brace of `` statements.
```scss
($a == 0) { }
if ($x == 2) { }
↑
/** ↑
* The space after this brace */
```
The `--fix` option on the [command line](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule.
This rule might have conflicts with stylelint's core [`block-closing-brace-space-after`](http://stylelint.io/user-guide/rules/block-closing-brace-space-after/) rule if the latter is set up in your `.stylelintrc` config file.
## Options
`string`: `"always-intermediate"|"never-intermediate"`
### `"always-intermediate"`
There *must always* be a single space after the closing brace of `` that is not the last statement in a conditional statement chain (i.e. does have another `` right after it).
The following patterns are considered warnings:
```scss
($x == 1) {
// ...
} if ($x == 2) {
// ...
} {}
($x == 1) {
// ...
} if ($x == 2) {
// ...
}
{ }
// `@else if` has a space and a newline after the closing brace
($x == 1) {
// ...
} if ($x == 2) {
// ...
}
{ }
($x == 1) {
// ...
} if ($x == 2) {
// ...
} { } // Two spaces
```
The following patterns are *not* considered warnings:
```scss
($x == 1) {
// ...
} if ($x == 2) {
// ...
} {}
a {
($x == 1) {
// ...
} ($x == 2) {
// ...
}
width: 10px;
}
($x == 1) { } if ($x == 2) {
// ...
} x;
($x == 1) {
// ...
} if ($x == 2) {
// ...
} x;
```
### `"never-intermediate"`
There *must never* be a whitespace after the closing brace of `` that is not the last statement in a conditional statement chain (i.e. does have another `` right after it).
The following patterns are considered warnings:
```scss
($x == 1) {
// ...
} if ($x == 2) {
// ...
} {}
($x == 1) {
// ...
} if ($x == 2) {
// ...
}
{ }
```
The following patterns are *not* considered warnings:
```scss
($x == 1) {
// ...
} {}
a {
($x == 1) {
// ...
} if ($x == 2) {
// ...
}
width: 10px;
}
($x == 1) { } if ($x == 2) {
// ...
} x;
($x == 1) {
// ...
} if ($x == 2) {
// ...
} x;
```