jfmengels / elm-lint / Lint

Module to configure your linting configuration and run it on a source file.

Linting

lint : List Rule -> Project -> { path : String, source : String } -> List Error

Lints a file and gives back the errors raised by the given rules.

config : List Rule
config =
    [ Some.Rule.rule
    , Some.Other.Rule.rule
    ]

project : Project
project =
    Project.new

errors : List Error
errors =
    lint config project sourceCode

Errors


type Error

Represents an error in a file found by a rule.

Note: This should not be confused with Error from the Lint.Rule module. Lint.Error is created from Lint.Rule.Error but contains additional information like the name of the rule that emitted it and the file name.

errorModuleName : Error -> Maybe String

Get the name of the module for which the error occurred.

errorRuleName : Error -> String

Get the name of the rule of an error.

errorMessage : Error -> String

Get the message of an error.

errorDetails : Error -> List String

Get the details of an error.

errorRange : Error -> Elm.Syntax.Range.Range

Get the range of an error.

errorFixes : Error -> Maybe (List Fix)

Get the fixes for an error.