Skip to content

Commit

Permalink
set dollar-variable-colon-space-after to always-single-line (#156)
Browse files Browse the repository at this point in the history
* set dollar-variable-colon-space-after to always-single-line

`'scss/dollar-variable-colon-space-after': 'always'` collides with the default formatting of Prettier when the value is broken into several lines.

For example, Prettier formats like this:

```css
$ratios:
    1 1,
    2 1,
    5 4,
    4 3,
    3 2,
    16 9,
    4 5,
    3 4,
    2 3,
    9 16;
```

While the rule set to `always` formats the same like this:

```css
$ratios: 1 1,
    2 1,
    5 4,
    4 3,
    3 2,
    16 9,
    4 5,
    3 4,
    2 3,
    9 16;
```

I propose to default to a setting that is compatible with Prettier.

* add test case
  • Loading branch information
woylie committed Apr 2, 2024
1 parent 57418df commit c318a27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions __tests__/valid.scss
Expand Up @@ -164,3 +164,9 @@ $theme-colors: (
from { opacity: 0; }
to { opacity: 1; }
}

$ratios:
5 4,
4 3,
3 2,
16 9;
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -34,7 +34,7 @@ module.exports = {
},
],
'scss/at-rule-conditional-no-parentheses': true,
'scss/dollar-variable-colon-space-after': 'always',
'scss/dollar-variable-colon-space-after': 'always-single-line',
'scss/dollar-variable-colon-space-before': 'never',
'scss/dollar-variable-empty-line-before': [
'always',
Expand Down

0 comments on commit c318a27

Please sign in to comment.