Reports when a Unit (()) is not matched in a pattern.
🔧 Running with --fix will automatically remove all the reported errors.
config =
[ NoUnmatchedUnit.rule
]
Fail
foo : () -> Int
foo _ =
3
Success
foo : () -> Int
foo () =
3
When (not) to enable this rule
Nobody on your team thinks explicitly matching against the Unit makes the code
more readable (as far as showing that there wasn't a "real" value being ignored).
When you feel that Unit is often used as a placeholder for a value that will
soon be filled in later.
Try it out
You can try this rule out by running the following command:
Reports when a Unit (
()) is not matched in a pattern.🔧 Running with
--fixwill automatically remove all the reported errors.Fail
Success
When (not) to enable this rule
Try it out
You can try this rule out by running the following command: