vercel / style-guide

Vercel's engineering style guide
Mozilla Public License 2.0
1.25k stars 33 forks source link

Enable `require-array-sort-compare` #61

Closed mrmckeb closed 1 year ago

mrmckeb commented 1 year ago

By default, sort first coerces items to strings, which will be unexpected behaviour for some/many engineers. See this thread for details: https://twitter.com/meoyawn/status/1659905876529143809

This rule requires that when arrays of items other than strings is being sorted, a compare function is supplied. https://typescript-eslint.io/rules/require-array-sort-compare/

mrmckeb commented 1 year ago

:tada: This PR is included in version 5.0.0 :tada:

The release is available on: