

You can install elm-format as the npm package: npm install -g elm-format You can add this setting globally or to a current workspace. Settings can be accessed via menu File -> Preferences -> Settings. To automatically format code on each file save, you can add the following line to the settings: I recommend to automatically format your Elm code on saving, so you’d never need to manually format it. It adds Elm syntax support and it supports elm-format. If you are using the Visual Studio Code as an editor, you need to install elm extension from the marketplace. Integrating elm-format with Visual Studio Code It supports popular code editors, so go on and check for the editor of your choice. You can integrate it with your code editor or run it separately. Here’s an example of how elm-format changes formatting of the code:
#Visual studio code format how to#
In this post, I will show how to integrate the elm-format with the Visual Studio Code. The rules are defined by the official Elm Style Guide. It makes code easier to read by forcing the same formatting rules for all Elm developers. The elm-format is a great tool that formats your Elm code.
