anmolitor / elm-review-tailwindcss / TailwindCss.NoUnknownClasses

rule : Options -> Review.Rule.Rule

Reports if you are using classes in your Html that are not known to postcss.

config =
    [ TailwindCss.NoUnknownClasses.rule { order = classOrder, checkedFunctions = [checkClassFunction] }
    ]

It is not recommended to define the `order` option manually. Instead you can use the [postcss-plugin](https://www.npmjs.com/package/elm-review-tailwindcss-postcss-plugin)
to generate the Elm code for you and then you can just import the `classOrder` in your `ReviewConfig.elm` file.

Fail

a =
    class "flex absolute unknown-class"

Success

a =
    class "flex absolute"

When (not) to enable this rule

This rule is useful when you are using tailwindcss and all your styles are known at build-time. This rule is not useful when you are not using tailwindcss, or you have stylesheets in your application that are injected at runtime.

Try it out

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

elm-review --template anmolitor/elm-review-tailwindcss/example --rules TailwindCss.NoUnknownClasses


type alias Options =
{ order : Dict String Basics.Int
, checkedFunctions : List TailwindCss.CheckedFunction.CheckedFunction 
}

Options for the NoUnknownClasses rule.

order:               should be generated from the postcss plugin
checkedFunctions:    a list of function calls to check for unknown class usages

defaultOptions : { order : Dict String Basics.Int } -> Options

Provide required options and defaults the other options