DirectivesSorter

Small Mix formatter plugin that does exactly one thing: sorts alias groups alphabetically.

Usage

  1. Add the plugin to your .formatter.exs:
[
  plugins: [DirectivesSorter.Plugin],
  inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
  1. Run mix format or format from your editor. Examples:

Before:

alias MyApp.Users.{Zed, Alpha, Beta}

After formatting:

alias MyApp.Users.{Alpha, Beta, Zed}

Multiline groups are supported; inline comments stay with their items.