Lleodevbro

sort-to-tosorted

Codemod to convert `[...array].sort()` into `array.toSorted()` (ES2023)

transformationmigration
Public
4 executions

Run locally

npx codemod sort-to-tosorted

sort-to-tosorted

Codemod to convert [...array].sort() into array.toSorted() (ES2023)

Run the script directly from the Codemod Registry

bash

Examples

Before:

ts

After:

ts

Installation

bash

Usage

Document the exact migration this codemod performs before publishing. At minimum, cover:

  • The concrete syntax or API patterns it rewrites
  • The file types or paths it targets
  • Important preserve/no-op cases and exclusions

Development

bash

License

MIT

Ready to contribute?

Build your own codemod and share it with the community.