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

rule : Review.Rule.Rule

Reports the use of Html.Attributes.style and Svg.Attributes.style.

config =
    [ ZenCss.NoHtmlStyles.rule
    ]

Fail

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

main : Html msg
main =
    Html.div [ Attributes.style "color" "blue" ]
        [ 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 inline style attributes 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.NoHtmlStyles