elm-lint analyzes your Elm source code, and tries to recognize patterns that may be considered harmful or can be improved upon.
The preferred method, if you have
npm installed, you can check out
node-elm-lint, which has instructions on. This will allow you to lint your whole project.
Also, you can try the unpolished online version here, where you can copy-paste your source code and see the linting errors.
Please note that the tool that analyzes your code has parsing issues and valid code may not be considered as such.
These are the rules that are built-in and available for you to choose from.
Debugbefore it goes into production.
module Main exposing (..), to make your module explicit in what it exposes.
List.map f >> List.map gto
List.map (f >> g)
(\x -> x.foo)to
(Critical) Parsing error: expected end of inputfor some of my files, what is happening?
This means that your file could not be parsed.
You should try and copy-paste that file's source code into the
elm-ast online demo to see if you can reproduce the error. If you are able to, then try to make a minimal reproducible example and open an issue on
In most cases, this is due to comments made using
-- a comment) that are not well handled by the parser. elm-lint tries to remove them before parsing, but does a bad job at it at the moment (help wanted).
At the moment,
elm-ast is missing positional information on the generated AST, that
elm-lint uses. You can follow this issue if you want to know more or to contribute.
Please open an issue here so we can talk about it. Try to make your proposal look like this.
[elm-lint] would like to be able to provide support for a plugin system so that you can work on it without my approval. Maybe that already works, but if it doesn't, please open an issue about that.
You're absolutely right. Please open an issue if you have suggestions or open a pull request!
elm-lint a long time ago, before it was even remotely usable at the Paris Elm Meetup. Maybe it will teach you about it. Otherwise, just open an issue to ask your question or hit me on the Elm Slack channel.