Open MariuzM opened 11 months ago
I know this is technically a necropost, but I feel like others will come across this in the future and want a solution.
"javascriptsolid"
isn't a file type recognised by VSCode. All JSX and TSX files match to "javascriptreact"
and "typescriptreact"
respectively.
With that in mind, the following regex can be used that maintains support for both className
and class
:
// settings.json
{
/* Other settings... */
"headwind.classRegex": {
"javascriptreact": "(?:\\b(?:className|class)\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)",
"typescriptreact": "(?:\\b(?:className|class)\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)"
}
}
The regexes replace className
with the non-capturing group (?:className|class)
.
P.S. You may need to restart VSCode after updating settings.json
.
Hope this helps 👍
I cant get headwind to work in Solidjs tsx component that is using
class
instead of React usingclassName
i tried but not working :(