git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Better unused import warnings
commit0e0a7233a182603d0041d5362460b121197c23b8 authorGary Burgess <gary.burgess@gmail.com> dateSun 3 Jan 2016, 16:18 (11 years ago) parentbc5f300
1 file changed+6−1
src/Language/PureScript/Linter/Imports.hs+6−1
src/Language/PureScript/Linter/Imports.hs+6−1
@@ -71,7 +71,12 @@ findUnusedImports (Module _ _ _ mdecls mexports) env usedImps = do
7171 typesRefs
7272 = map (flip TypeRef (Just [])) typesWithoutDctors
7373 ++ map (\(ty, ds) -> TypeRef ty (Just ds)) (M.toList typesWithDctors)
74− in tell $ errorMessage $ ImplicitImport mni (classRefs ++ typesRefs ++ valueRefs)
74+ allRefs = classRefs ++ typesRefs ++ valueRefs
75+ in tell $ errorMessage $
76+ if null allRefs
77+ then UnusedImport mni
78+ else ImplicitImport mni allRefs
79+ Explicit [] -> tell $ errorMessage $ UnusedImport mni
7580 Explicit declrefs -> do
7681 let idents = nub (mapMaybe runDeclRef declrefs)
7782 let diff = idents \\ usedNames