mirror of
https://github.com/jfmengels/elm-review.git
synced 2025-01-07 02:09:35 +03:00
Improve error message
This commit is contained in:
parent
9fce35936c
commit
4ced912e03
@ -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 } }
|
||||
)
|
||||
|
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user