Install Development Tools

The Elm community has adopted an official style guide[48] for formatting Elm code. This book’s code examples adhere to this style guide except where it might drastically increase page length or extend past margins. Instead of manually formatting code yourself, you can use the elm-format package to automatically format your code to community conventions. Install it with this npm command:

 npm install -g elm-format

As of this writing, I used elm-format version 0.8.1 to format code samples in this book.

The elm-format repository[49] also provides links to integrate elm-format with your editor so you don’t have to manually run it from the command line.

For more Elm integration inside your editor such as syntax highlighting ...

Get Programming Elm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.