elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
Version 0.8.6 was not widely announced because of an issue with the npm installer on Windows, so check the 0.8.6 release notes as well. Below are the additional changes in 0.8.7.
New features:
case ... then
is now auto-corrected to case ... of
=>
is now auto-corrected to ->
Bug fixes:
npm install -g elm-format
or download from the release page.
Thanks to the contributions of many (see below), elm-format is now much faster. (Testers of the pre-release saw an 11x speedup on MacOS ARM, and a 4x speedup on other platforms.)
New features:
Bug fixes:
module exposing
listings containing comments no longer add extra leading spacesOther changes:
npm install -g elm-format
or download from the release page.
exposing
listings bug fixFeature changes:
elm make
to see a detailed error if elm-format fails.New features:
module
and import
lines, exposing
is automatically added if missingOther changes:
--upgrade
(now use elm-refactor instead)npm install -g elm-format
or download from the release page.
New features:
Bug fixes:
Other changes:
npm install -g elm-format
or download from the release page.
Thanks to @folkertdev for diagnosing and contributing the fix for a long-standing performance issue
where elm-format
would take exceptionally long (and sometimes crash) on files contianing large expressions
such as long lists or many other AST nodes with many children.
Other than the performance improvements, there should be no other noticable changes from elm-format
0.8.2.
npm install -g elm-format
or download from the release page.
Two small improvements should make integration with code editors smoother with elm-format
0.8.2.
When installed with npm
, elm-format
startup time has been reduced by 70% (roughly 150ms).
And elm-format
will now assume it should work in Elm 0.19 mode if autodetection of your Elm version fails.
If you still need to work with Elm 0.18 code, you must make sure that either elm-format
is run from the directory containing your elm-package.json
file (and there must not be a elm.json
file in that directory), or elm-format
must be invoked with the --elm-version=0.18
option.
exposing (..)
The feature of automatically expanding exposing (..)
in module
lines has been removed.
While exposing everything in a module is an anti-pattern for production code,
it can be useful for rapid development sketches when the interfaces of your modules are not important.
To replace the old expansion behavior, elm-format
now allows module
lines without an exposing
clause. Such lines will have the exposing
automatically generated using the same logic that was previously used to expand exposing (..)
.
elm-format
0.8.2 also contains several bug fixes and other small changes.
See the CHANGELOG for details.
npm install -g elm-format
or download from the release page.
(..)
in @docs
linesStarting in elm-format
0.8.1, there is now only one official binary for each platform
(previously there was a seperate binary for Elm 0.18 and Elm 0.19).
elm-format
now will auto-detect your Elm version using the following rules:
elm-package.json
exists in the current directory, format in Elm 0.18 modeelm.json
exists in the current directory, format in Elm 0.19 modeIf you need to run elm-format
from a working directory that does not contain such a file
(or if you need to use elm-format
in Elm 0.17 mode),
use the --elm-version=...
command line argument to disable the autodetection.
elm-format
0.8.1 also contains several bug fixes for elm-format
0.8.0.
See the CHANGELOG for details.
npm install -g elm-format
or download from the release page.