Analyzes Elm projects, to help find mistakes before your users find them.
Go to file
2017-01-19 23:56:49 +01:00
example Make AST rendering less cluttered 2017-01-19 23:56:49 +01:00
rules Fix NoDuplicateImports bug when importing submodules 2017-01-19 22:30:50 +01:00
tests Fix NoDuplicateImports bug when importing submodules 2017-01-19 22:30:50 +01:00
.gitignore Init project and copy example from bogdanp/elm-ast 2017-01-07 18:30:16 +01:00
elm-package.json Add NoDebug rule 2017-01-07 21:17:12 +01:00
Lint.elm Changed rule signature to be able to make a list of rules 2017-01-15 23:24:37 +01:00
README.md Add NoDuplicateImports rule 2017-01-19 21:02:21 +01:00
Types.elm Make type Error contain the rule name 2017-01-15 23:30:33 +01:00
Visitor.elm Add tests for NoDebug and visit all expression types 2017-01-16 00:51:31 +01:00

elm-lint

An Elm linter written in Elm.

Try it

This is a prototype, so there is no CLI yet, but you can test elm-lint online here. Enter your source code in the top-left box, and see the reported errors in the bottom-left box.

Please note that the tool that analyzes your code has parsing issues and valid code may not be considered as such.

What does this tool do?

elm-lint analyzes your Elm source code, and tries to recognize patterns that may be considered harmful. If you are familiar with ESLint from JavaScript, this is pretty much the same idea.

You can read the slides for my presentation of this tool to learn more about it.

Rules

  • NoUnusedVariables - Reports variables that are declared but never used.
  • NoDebug - Forbid the use of Debug before it goes into production.
  • NoDuplicateImports - Forbid importing the same module several times in a file.
  • NoUnannotatedFunction - Ensure every top-level function declaration has a type annotation.
  • NoExposingEverything - Forbid exporting everything in your modules module Main exposing (..), to make your module explicit in what it exposes.

More rule ideas in this slide and the ones below it. Note that some rules were implemented but may not be good ideas. Think for yourself and ask the community whether you should enable them.

MIT © Jeroen Engels