Improve error message

This commit is contained in:
Jeroen Engels 2024-05-07 23:03:28 +02:00
parent 9fce35936c
commit 4ced912e03
2 changed files with 5 additions and 5 deletions

View File

@ -203,11 +203,11 @@ reportUnusedClasses usedCssClasses filePath { fileKey, classes } =
else
Just
(Rule.errorForExtraFile fileKey
{ message = "Found unused CSS classes in " ++ filePath
{ message = "Found unused CSS classes"
, details =
[ "This file declared the usage of some CSS classes for which I could not any usage in the Elm codebase. Please check that no typo was made in the name of the classes, and remove them if they still seem unused."
, "Here are the classes that seem unused: " ++ String.join " " (Set.toList unusedClasses)
]
}
{ start = { row = 1, column = 1 }, end = { row = 2, column = 1 } }
{ start = { row = 1, column = 1 }, end = { row = 1, column = 100000 } }
)

View File

@ -39,10 +39,10 @@ view model =
(cssFiles [ FilePattern.include "*.css" ] |> rule)
|> Review.Test.expectErrorsForExtraFile "some-file.css"
[ Review.Test.error
{ message = "Unknown CSS class \"unknown\""
{ message = "Found unused CSS classes"
, details =
[ "I could not find this class in CSS files. Have you made a typo?"
, "Here are similarly-named classes:\n - unknown2\n - known"
[ "This file declared the usage of some CSS classes for which I could not any usage in the Elm codebase. Please check that no typo was made in the name of the classes, and remove them if they still seem unused."
, "Here are the classes that seem unused: unused"
]
, under = "-- First line"
}