Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable require-array-sort-compare #61

Closed
mrmckeb opened this issue May 22, 2023 · 1 comment
Closed

Enable require-array-sort-compare #61

mrmckeb opened this issue May 22, 2023 · 1 comment
Labels
enhancement New feature or request eslint

Comments

@mrmckeb
Copy link
Contributor

mrmckeb commented May 22, 2023

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 mrmckeb added enhancement New feature or request eslint labels May 22, 2023
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #61

BREAKING CHANGE: A compare function is now required when calling `sort` on non-string arrays.
This change applies to TypeScript only.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #61

BREAKING CHANGE: A compare function is now required when calling `sort` on non-string arrays.
This change applies to TypeScript only.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #61

BREAKING CHANGE: A compare function is now required when calling `sort` on non-string arrays.
This change applies to TypeScript only.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #61

BREAKING CHANGE: A compare function is now required when calling `sort` on non-string arrays.
This change applies to TypeScript only.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #61

BREAKING CHANGE: A compare function is now required when calling `sort` on non-string arrays.
This change applies to TypeScript only.
mrmckeb added a commit that referenced this issue Aug 29, 2023
Resolves #61

BREAKING CHANGE: A compare function is now required when calling `sort` on non-string arrays.
This change applies to TypeScript only.
@mrmckeb
Copy link
Contributor Author

mrmckeb commented Aug 29, 2023

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request eslint
Projects
None yet
Development

No branches or pull requests

1 participant