Skip to content

Instantly share code, notes, and snippets.

@ShrykeWindgrace
Created September 22, 2020 12:07
Show Gist options
  • Save ShrykeWindgrace/6ed0fd9335cfa9e200da68674bedfccb to your computer and use it in GitHub Desktop.
Save ShrykeWindgrace/6ed0fd9335cfa9e200da68674bedfccb to your computer and use it in GitHub Desktop.
False positive on `NoUnused.CustomTypeConstructorArgs`
module Main exposing (Model, main) -- src/Main.elm
import Browser
import Html exposing (Html, div, text)
import Html.Attributes exposing (id)
import Messages exposing (Msg(..))
main : Program () Model Msg
main =
Browser.document
{ init = init
, subscriptions = subscriptions
, view = view
, update = update
}
type alias Model =
{ content : String }
defModel : Model
defModel =
{ content = "" }
init : a -> ( Model, Cmd msg )
init _ =
( defModel, Cmd.none )
subscriptions : a -> Sub msg
subscriptions _ =
Sub.none
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
Content s ->
( { model | content = "content " ++ s }, Cmd.none )
Search string ->
( { model | content = "search " ++ string }, Cmd.none )
view : Model -> Browser.Document Msg
view model =
{ title = ""
, body =
[ div [] [ text model.content ]
]
}
module Messages exposing (Msg(..)) -- src/Messages.elm
type Msg
= Content String
| Search String
module ReviewConfig exposing (config) -- review/src/ReviewConfig.elm
import NoUnused.CustomTypeConstructorArgs
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoUnused.CustomTypeConstructorArgs.rule
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment