← All recipes
Moderne licensed

Order imports

Recipe IDorg.openrewrite.javascript.cleanup.order-importsArtifact@openrewrite/rewrite

Sort imports by category and module path. Categories: side-effect, namespace, default, named, type. Within each category, imports are sorted alphabetically by module path. Named specifiers within each import are also sorted alphabetically.

Single recipeMSAL

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.javascript.cleanup.order-imports

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/rewrite