Repository: prettier/prettier (JavaScript)

Issue:
[scss] Wildcard syntax in `@forward` broken
Using the latest prettier wildcard syntax is broken when using `@forward` pattern.
It worked as desired in v2.3.2.

**Prettier 2.4.0**
[Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEABAZhATgdwIZYAmABAOQB0A9AA54wAWpxeAzsbQwLQBUA3ADpQM2fETJVIAG2xNWxKdh4ChmXARIVKcSXAC2CGLLba9BpYJAAaEBGowAltBbJQBLBBwAFAgmco8kvgAns7WAEZYeGAA1nAwAMp4+gAy9lBwyOgBLHDhkTFx8bRgaQDmyDBYAK65IHphcISEjcl4UKVVeKVwAGLYunQO7cggeFUwEFYg9DC6kgDq9PbwLMVw8b7L9gBuy0EjYCyhIGk5WDCekaUDmdm1AFYsAB7xZToAilUQ8LeSOda0LBnEYsQ7HahYNIweb2QgMZAADgADAD3Dl5pFqCMIXAztsMtYAI5feCXWx+UYsTjpRqNKZYODE+wMy5dG5ILJ-Wo5XT2CrVblvOCfb4ZDl3awwPBhGFw+jIABMksi9kkZQAwhBdOy6iwAKxTKo5AAq0r8nP+IG2NQAklBmrB4mBIXYAIL2+IwII6X45AC+fqAA)
<!-- prettier-ignore -->
```sh
--parser scss
```

**Input:**
<!-- prettier-ignore -->
```scss
@forward './path' as path-*;
@forward './color' as color-*;
@forward './element' as element-*;

```

**Output:**
<!-- prettier-ignore -->
```scss
@forward "./path" as path- *;
@forward "./color" as color- *;
@forward "./element" as element- *;

```

**Expected behavior:**

Wildcard syntax should be preserved.

<!-- prettier-ignore -->
```scss
@forward "./path" as path-*;
@forward "./color" as color-*;
@forward "./element" as element-*;

```


Hints:
Regression, thanks
Due https://github.com/prettier/prettier/pull/11461

/cc @niksy 

Patch:
diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js
--- a/src/language-css/printer-postcss.js
+++ b/src/language-css/printer-postcss.js
@@ -550,6 +550,19 @@ function genericPrint(path, options, print) {
           continue;
         }
 
+        // Ignore SCSS @forward wildcard suffix
+        if (
+          insideAtRuleNode(path, "forward") &&
+          iNode.type === "value-word" &&
+          iNode.value &&
+          iPrevNode.type === "value-word" &&
+          iPrevNode.value === "as" &&
+          iNextNode.type === "value-operator" &&
+          iNextNode.value === "*"
+        ) {
+          continue;
+        }
+
         // Ignore after latest node (i.e. before semicolon)
         if (!iNextNode) {
           continue;


Test patch:
diff --git a/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap b/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap
--- a/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/format/scss/quotes/__snapshots__/jsfmt.spec.js.snap
@@ -29,6 +29,8 @@ singleQuote: true
 
 @forward "library" as btn-*;
 
+@forward "library" as btn*;
+
 =====================================output=====================================
 @use 'library';
 
@@ -47,7 +49,9 @@ singleQuote: true
 
 @forward 'library' hide gradient;
 
-@forward 'library' as btn- *;
+@forward 'library' as btn-*;
+
+@forward 'library' as btn*;
 
 ================================================================================
 `;
@@ -80,6 +84,8 @@ printWidth: 80
 
 @forward "library" as btn-*;
 
+@forward "library" as btn*;
+
 =====================================output=====================================
 @use "library";
 
@@ -98,7 +104,9 @@ printWidth: 80
 
 @forward "library" hide gradient;
 
-@forward "library" as btn- *;
+@forward "library" as btn-*;
+
+@forward "library" as btn*;
 
 ================================================================================
 `;
diff --git a/tests/format/scss/quotes/quotes.scss b/tests/format/scss/quotes/quotes.scss
--- a/tests/format/scss/quotes/quotes.scss
+++ b/tests/format/scss/quotes/quotes.scss
@@ -19,3 +19,5 @@
 @forward "library" hide gradient;
 
 @forward "library" as btn-*;
+
+@forward "library" as btn*;