Skip to content

Using localeCompare may be dangerous #18

@marek-aguita

Description

@marek-aguita

Hi,

My teammates and me have noticed you guys are using localeCompare to sort attributes:

group.values.sort((a, b) => getString(a).localeCompare(getString(b)));

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions