NiklasPor / prettier-plugin-organize-attributes

Organize your HTML attributes automatically with Prettier 🧼
MIT License
197 stars 12 forks source link

Using localeCompare may be dangerous #18

Open marek-aguita opened 1 year ago

marek-aguita commented 1 year ago

Hi,

My teammates and me have noticed you guys are using localeCompare to sort attributes: https://github.com/NiklasPor/prettier-plugin-organize-attributes/blob/50a0c4f8809c34b351a400011b7734701285b5e9/src/organize.ts#L108

It took me a while to figure out why prettier sorts the HTML attributes differently on different machines (localeCompare uses the locale stored in the OS).

You should maybe consider changing the compare method :)

Thank you!

NiklasPor commented 1 year ago

Good catch, will do!