jfmengels / elm-review-debug / NoDebug.Log

rule : Review.Rule.Rule

Forbid the use of Debug.log before it goes into production or fails in the CI.

🔧 Running with --fix will automatically remove all the reported errors.

Debug.log is useful to debug your code, but should not be pushed to production.

config =
    [ NoDebug.Log.rule
    ]

Fail

if Debug.log "condition" condition then
    a

else
    b

Success

if condition then
    a

else
    b

When (not) to use this rule

You should use this rule if you're developing a package meant to be published, or an application that is put into production, and wish to know about the use of Debug.log module before committing your changes.

You should not use this rule if you are developing an application that is not put into production, and you do not care about having stray debug logs, and you do not ship to production.

Try it out

You can try this rule out by running the following command:

elm-review --template jfmengels/elm-review-debug/example --rules NoDebug.Log