decioferreira / elm-review-zen-css / ZenCss.NoHtmlClasses

rule : Review.Rule.Rule

Reports the use of Html.Attributes.class, Html.Attributes.classList and Svg.Attributes.class.

config =
    [ ZenCss.NoHtmlClasses.rule
    ]

Fail

import Html exposing (Html)
import Html.Attributes as Attributes

main : Html msg
main =
    Html.div [ Attributes.class "container" ]
        [ Html.text "Hello!" ]

Success

import CSS.Attributes
import Classes
import Html exposing (Html)

main : Html msg
main =
    Html.div [ CSS.Attributes.class Classes.container ]
        [ Html.text "Hello!" ]

When (not) to enable this rule

This rule is useful when using the elm-zen-css library. This rule is not useful when references to CSS classes are still required.

Try it out

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

elm-review --template decioferreira/elm-review-zen-css/example --rules ZenCss.NoHtmlClasses