Fix wildcard syntax in @forward (#11482)#11487
Conversation
9aa02da to
f83ec5c
Compare
| insideAtRuleNode(path, "forward") && | ||
| iNode.type === "value-word" && | ||
| iNode.value && | ||
| iNode.value.endsWith("-") && | ||
| iPrevNode.type === "value-word" && | ||
| iPrevNode.value && | ||
| iPrevNode.value === "as" && | ||
| iNextNode.type === "value-operator" && | ||
| iNextNode.value && | ||
| iNextNode.value === "*" |
There was a problem hiding this comment.
@alexander-akait Could you check if this condition works file? Sorry I'm not familiar with SCSS...
There was a problem hiding this comment.
Ideally we need special logic for @use/@forward, but it will require parser for this, postcss-values-parser violate spec in many places, to solve it in right way we need another parser, so I think we can safely merge it
There was a problem hiding this comment.
@sosukesuzuki @alexander-akait check is based on official documentation on prefixes. @forward is available only for Sass files.
sosukesuzuki
left a comment
There was a problem hiding this comment.
Thanks for your quick PR!
|
@fisker Can you review this? If you approve this, I'll release new patch version. |
|
Are these valid? Prettier pr-11487 --parser scssInput: @forward "library" as btn*;
@forward "library" as btn-*-x;
@forward "library" as btn*-*;Output: @forward "library" as btn *;
@forward "library" as btn-* -x;
@forward "library" as btn * - *;
|
|
This should not related to this PR, but somehow cross the printWidth Prettier pr-11487 --parser scssInput: @forward 'library' with (
$black: #222 !default,
$border-radius: 0.1rem !default
);Output: @forward "library" with ($black: #222 !default, $border-radius: 0.1rem !default);
|
Only the first is valid, and I’ve made changes to reflect that. Other two are invalid Sass syntax for |
You’re right, this is not related to this PR. I will create new one with adjustments. EDIT: Done! |
9b5f307 to
4e226bb
Compare
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
|
I'll release new patch version includes this. |
|
done |
Description
Fixes #11482.
Checklist
docs/directory).changelog_unreleased/*/XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨