Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Conversation

@petertriho
Copy link

@petertriho petertriho commented Feb 19, 2021

This should be a better regex that works with curly braces {} in react jsx (I believe it should work in reason as well?)

Now works with the following:
className="class1 class2"
className='class1 class2'
className={"class1 class2"}
className={'class1 class2'}
className={clsx("class1 class2")}
className={clsx(foo, bar, "class1 class2", bar)}
className={classname(foo, bar, "class1 class2", bar)}
className={anything(foo, bar, "class1 class2", bar)}

Issues:

  • Only sorts first string it encounters i.e.only sorts the first string ("class1 class2") in
    className={clsx("class1 class2", foo, bar, "class3 class4", bar)}

reason/javascript/javascriptreact/typescript/typescriptreact
@CarterScadden
Copy link

Is there any update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants