seems to have no effect on class lists in template literals
See original GitHub issueas an example:
<div
className={`
flex
flex-col
justify-between
flex-1
p-6
bg-gradient-to-br
bg-white
from-white
to-gray-200
dark:bg-gray-800
dark:from-gray-800
dark:to-gray-900
dark:text-gray-50
${className}
`}
>
plugin seems to not operate on these strings, flattening them into a single line seems to not have any effect either
I have also tried randomly shuffling the class list to see if they were already sorted
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >javascript - Template literals like 'some ${string}' or "some ...
Save this question. Show activity on this post. I wanted to try using template literals and it's not working: it's displaying the literal...
Read more >Restrict template literal interpolation expressions to strings
String literal templates only deal with strings; it seems well within the purpose of TypeScript to enforce that we can only pass them...
Read more >Understanding Template Literals in JavaScript - DigitalOcean
With template literals, an expression can be embedded in a placeholder. A placeholder is represented by ${} , with anything within the curly ......
Read more >8. Template literals - Exploring JS
A separate section explains how a template literal is turned into a list of arguments: the template object and the substitutions.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @bradlc
I just gave this plugin a shot, and I’m seeing a similar behavior:
Notice how the second list of classes is fixed when I run prettier, but not the one in the variable:
Most of my components are build that way, here is a slightly less contrived example:
In which case, again,
'pt-2 p-4'
is not fixed either…Thank you for the hard work
I do it like this, because there will be a lot of dynamic building up of strings