Handle quote escapes in LESS when sorting @apply#392
Merged
thecrypticace merged 2 commits intomainfrom Aug 29, 2025
Merged
Conversation
It’s perfect since the AST doesn’t actually have information on these (it’s just strings) but this should be good enough.
RobinMalfait
approved these changes
Aug 29, 2025
Member
RobinMalfait
left a comment
There was a problem hiding this comment.
Tested it with:
t`@apply ~"absolute top-[80px] right-[20px] z-10 flex items-center";`,Which fails with the " in the wrong spot before this fix. And works with the " in the correct spot (and properly sorted classes) after the fix.
Member
|
You might want to run prettier: diff --git a/tests/tests.ts b/tests/tests.ts
index f4f8be5..bcff661 100644
--- a/tests/tests.ts
+++ b/tests/tests.ts
@@ -266,7 +266,12 @@ export let tests: Record<string, TestEntry[]> = {
t`@apply ${yes} #{'''!important'''};`,
t`@apply ${yes} #{"'"'"!important"'"'"};`,
],
- less: [...css, t`@apply ${yes} !important;`, t`@apply ~"${yes}";`, t`@apply ~'${yes}';`],
+ less: [
+ ...css,
+ t`@apply ${yes} !important;`,
+ t`@apply ~"${yes}";`,
+ t`@apply ~'${yes}';`,
+ ],
babel: javascript,
typescript: javascript,
'babel-ts': javascript, |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It’s perfect since the AST doesn’t actually have information on these (it’s just strings) but this should be good enough.
Fixes #323