heybourn / headwind

An opinionated Tailwind CSS class sorter built for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=heybourn.headwind
MIT License
1.37k stars 46 forks source link

How do I make headwind work on js files? #192

Open JoshKasap opened 1 year ago

JoshKasap commented 1 year ago

can someone help me get this working with js files. It looks like i'm supposed to use regex in settings.json file but

  1. I don't really understand regex
  2. it appears there already is some regex for JavaScript despite it seemingly not working.

in my js file i have some code like this.

let html = `
<div class="mr-2 bg-red-100 ml-3"></div>
<div class='mr-2 bg-red-100 ml-3'></div>
`

I would like the classes in their to be sorted. both if using single or double quotes. Is this possible and could someone help me get it working if so?

hacknug commented 1 year ago

You have a bunch of alternative regex on the issues. I'd take a look at the ones on #85 since those may be what you're looking for 👍