A tool that allows you to analyse your Elm code, identify deficiencies and apply best practices.
The following binaries should be available on the path:
node >=8 elm 0.19.x elm-format (a version that is compatible with the source code you wish to analyse)
npm install -g elm-analyse
or if using
yarn global add elm-analyse
Change to the directory of Elm project you want to analyse and run
-s option for server mode. This will allow you to view results in your browser. To change the port use
||Print the help output.|
||Enable server mode. Disabled by default.|
||The port on which the server should listen. Defaults to 3000 (
||Open default browser when server goes live.|
||Path to elm-format. Defaults to
||Print version of software.|
||Output format for CLI. Defaults to "human". Valid values are either "human" or "json".|
All supported checks can be found in the check documentation.
Checks can be enable or configured based on your preferences. For this see the Configuration Docs.
If you have feature ideas or checks that you wish to see, please create an issue. Please check that you do not create duplicate issues or a check for which we already have a report.
The library is divided into the following main modules:
mainfile that bootstraps the analysis and maintains the core state.
ASTUtil.*: Utility functions for fact extraction on the AST.
Analyser.Checks.*: All the checks that are performed.
Analyser.Fixes.*: All the fixes that can be performed.
Analyser.Messages.*: All messages that can be produced and the supporting functions.
Client.*: Front-end code for running in 'server' mode.
The code that represents the Elm syntax and the parsing is supported by the elm-syntax package.