Provides elm-review
rules to ensure that anything (readily) sortable in Elm code is sorted in the
"proper" order.
NoUnsortedCases - Reports case patterns that are not in the "proper" order.NoUnsortedLetDeclarations - Reports let declarations that are not in the "proper" order.NoUnsortedRecords - Reports record fields that are not in the "proper" order.NoUnsortedTopLevelDeclarations - Reports top-level declarations that are not in the "proper" order.module ReviewConfig exposing (config)
import NoUnsortedCases
import NoUnsortedLetDeclarations
import NoUnsortedRecords
import NoUnsortedTopLevelDeclarations
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoUnsortedCases.rule NoUnsortedCases.defaults
, NoUnsortedLetDeclarations.rule
(NoUnsortedLetDeclarations.sortLetDeclarations
|> NoUnsortedLetDeclarations.alphabetically
)
, NoUnsortedRecords.rule
(NoUnsortedRecords.defaults
|> NoUnsortedRecords.reportAmbiguousRecordsWithoutFix
)
, NoUnsortedTopLevelDeclarations.rule
(NoUnsortedTopLevelDeclarations.sortTopLevelDeclarations
|> NoUnsortedTopLevelDeclarations.portsFirst
|> NoUnsortedTopLevelDeclarations.exposedOrderWithPrivateLast
|> NoUnsortedTopLevelDeclarations.alphabetically
)
]You can try the example configuration above out by running the following command:
elm-review --template SiriusStarr/elm-review-no-unsorted/example1.0.1 -- Fix crash in handling of generic records when not all fields must
be present.1.0.0 -- Initial release