I haven’t used Elm since version 0.12. During my vacation, I wanted to get a deeper dive into the effort people have put into it since then. Elm’s compiler is great at identifying errors in your code, but it happened after I tried to run my code or use elm-make on it.

Below are some of the plugins I found useful when writing Elm:

language-elm

language-elm provides syntax highlighting and snippets. It forms the basis for every other plugin described.

apm install language-elm

elm-format

elm-format in action

elm-format is like gofmt in that it formats Elm source code according to a standard set of rules based on the official Elm Style Guide. Installing the apm package is not enough though, you need to install the tool. I’d recommend using the following brew command which grabs the recipe from the homebrew-devel tap.

brew install homebrew/devel-only/elm-format --devel

The recipe by default installs elm-format for the last three(?) versions of Elm. We will need to create a symlink so that the atom package calls out to the right binary.

# Remember to substitute the version number if >= 0.19 is out
ln -s "$(brew --prefix)/bin/elm-format-0.18" /usr/local/bin/elm-format

Once installed, Elm code will format to match the styling guide on save.

apm install elm-format

linter-elm-make

elm-make in action

linter-elm-make brings in helpful error messages to Atom. It has options to lint as you type or on save.

Autocompletion

To enable autocompletion, we will need to install elm-oracle via npm. elm-oracle queries for information about values in Elm source files. I’d recommend to install it globally via [Yarn][yarn]:

yarn global add elm-oracle

elmjutsu

Once elm-oracle is available, we will need elmjutsu to enable proper autocomplete.

apm install elmjutsu

After installing elmjutsu, we need to disable autocomplete for language-elm and enable it for elmjutsu.