Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly format Sass module configuration values
- Loading branch information
Showing
6 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#### Properly format Sass module configuration values (#11516 by @niksy) | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
// Input | ||
@use "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $counters: (1, 2, 3)); | ||
|
||
// Prettier stable | ||
@use "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $counters: (1, 2, 3)); | ||
|
||
// Prettier main | ||
@use "library" with ( | ||
$black: #222, | ||
$border-radius: 0.1rem, | ||
$font-family: "Helvetica, sans-serif", | ||
$list: ( | ||
1, | ||
2, | ||
3, | ||
) | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
tests/format/scss/print-width/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`print-width.scss - {"printWidth":40} format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["scss"] | ||
printWidth: 40 | ||
| printWidth | ||
=====================================input====================================== | ||
@use "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $list: (1, 2, 3)); | ||
@forward "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $list: (1, 2, 3)); | ||
=====================================output===================================== | ||
@use "library" with ( | ||
$black: #222, | ||
$border-radius: 0.1rem, | ||
$font-family: "Helvetica, sans-serif", | ||
$list: ( | ||
1, | ||
2, | ||
3, | ||
) | ||
); | ||
@forward "library" with ( | ||
$black: #222, | ||
$border-radius: 0.1rem, | ||
$font-family: "Helvetica, sans-serif", | ||
$list: ( | ||
1, | ||
2, | ||
3, | ||
) | ||
); | ||
================================================================================ | ||
`; | ||
|
||
exports[`print-width.scss format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["scss"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
@use "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $list: (1, 2, 3)); | ||
@forward "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $list: (1, 2, 3)); | ||
=====================================output===================================== | ||
@use "library" with ( | ||
$black: #222, | ||
$border-radius: 0.1rem, | ||
$font-family: "Helvetica, sans-serif", | ||
$list: ( | ||
1, | ||
2, | ||
3, | ||
) | ||
); | ||
@forward "library" with ( | ||
$black: #222, | ||
$border-radius: 0.1rem, | ||
$font-family: "Helvetica, sans-serif", | ||
$list: ( | ||
1, | ||
2, | ||
3, | ||
) | ||
); | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
run_spec(__dirname, ["scss"]); | ||
run_spec(__dirname, ["scss"], { printWidth: 40 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@use "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $list: (1, 2, 3)); | ||
|
||
@forward "library" with ($black: #222, $border-radius: 0.1rem, $font-family: "Helvetica, sans-serif", $list: (1, 2, 3)); |