Closed Alonski closed 3 years ago
I'm pretty horrible with REGEX so couldn't help you here - maybe @praveenperera has some ideas?
@Alonski here is the regex that works: https://regex101.com/r/ewrRFX/1
Try:
- "javascript": "(?:\\bclassName\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)"
+ "javascript": "(?:\\bclassNames?\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)"
It will watch one both className = ...
and classNames = ...
@praveenperera Sorry for the late followup. So I tried what you suggested and Headwind still isn't sorting the classes :)
Is your feature request related to a problem? Please describe. Hello, I am trying to set up Headwind for use in Javascript files.
I have getters where I use a switch-case to choose the classNames for a component in Ember. Headwind works in templates but I can't seem to get it to work in Javascript.
This is my code:
I tried setting this regex but it might be wrong :)