diff --git a/Data/Conduit/Parser/XML.hs b/Data/Conduit/Parser/XML.hs
--- a/Data/Conduit/Parser/XML.hs
+++ b/Data/Conduit/Parser/XML.hs
@@ -47,7 +47,7 @@
 import           Control.Monad.Catch
 
 import           Data.Char
-import           Data.Conduit                     hiding (await)
+import           Data.Conduit
 import           Data.Conduit.Parser
 import           Data.Conduit.Parser.XML.Internal
 import           Data.Map                         as Map hiding (map, null)
@@ -171,7 +171,7 @@
 contentsToText =
     mconcat . map toText
   where
-    toText (ContentText t) = t
+    toText (ContentText t)   = t
     toText (ContentEntity e) = mconcat ["&", e, ";"]
 
 -- | Alias for 'Reexport.parseText''
diff --git a/Data/Conduit/Parser/XML/Internal.hs b/Data/Conduit/Parser/XML/Internal.hs
--- a/Data/Conduit/Parser/XML/Internal.hs
+++ b/Data/Conduit/Parser/XML/Internal.hs
@@ -7,7 +7,7 @@
 import           Control.Monad.Catch
 
 import           Data.Conduit.Parser
-import           Data.Map                as Map hiding (map)
+import           Data.Map                as Map
 import           Data.Text               (Text)
 import           Data.XML.Types
 
@@ -94,7 +94,7 @@
   event <- await
   case event of
    EventComment t -> return t
-   _ -> unexpected $ "Expected XML comment, got: " ++ show event
+   _              -> unexpected $ "Expected XML comment, got: " ++ show event
 
 -- | Parse an 'EventCDATA'.
 cdata :: (MonadCatch m) => ConduitParser Event m Text
@@ -102,7 +102,7 @@
   event <- await
   case event of
    EventCDATA t -> return t
-   _ -> unexpected $ "Expected XML CDATA, got: " ++ show event
+   _            -> unexpected $ "Expected XML CDATA, got: " ++ show event
 
 -- | Parse a textual 'EventContent' or an 'EventCDATA'.
 text :: (MonadCatch m) => ConduitParser Event m Text
diff --git a/test/HLint.hs b/test/HLint.hs
new file mode 100644
--- /dev/null
+++ b/test/HLint.hs
@@ -0,0 +1,8 @@
+import qualified Language.Haskell.HLint as HLint (hlint)
+import           System.Exit
+
+
+main :: IO ()
+main = do
+  result <- HLint.hlint [ "test/", "Data/" ]
+  if null result then exitSuccess else exitFailure
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -1,15 +1,13 @@
 {-# LANGUAGE OverloadedStrings #-}
+import           Data.Conduit.Parser.XML
+
 import           Control.Applicative
 import           Control.Monad.Trans.Resource
-
 import           Data.Conduit
 import           Data.Conduit.List            (sourceList)
 import           Data.Conduit.Parser
-import           Data.Conduit.Parser.XML
 import           Data.Default
 import           Data.Foldable
-
-import qualified Language.Haskell.HLint       as HLint (hlint)
 import           Test.Tasty
 import           Test.Tasty.HUnit
 -- import           Test.Tasty.QuickCheck
@@ -19,7 +17,6 @@
 main = defaultMain $ testGroup "Tests"
   [ unitTests
   -- , properties
-  , hlint
   ]
 
 unitTests :: TestTree
@@ -100,9 +97,3 @@
           , "</hello>"
           ]
         parser = tagNoAttr "hello" $ tagNoAttr "failure" (return 1) <|> tagNoAttr "success" (return 2)
-
-
-hlint :: TestTree
-hlint = testCase "HLint check" $ do
-  result <- HLint.hlint [ "test/", "Data/" ]
-  null result @?= True
diff --git a/xml-conduit-parse.cabal b/xml-conduit-parse.cabal
--- a/xml-conduit-parse.cabal
+++ b/xml-conduit-parse.cabal
@@ -1,5 +1,5 @@
 name:                xml-conduit-parse
-version:             0.3.1.1
+version:             0.3.1.2
 synopsis:            Streaming XML parser based on conduits.
 description:
   This library provides an alternative, hopefully higher-level implementation for the parsing part of @xml-conduit@.
@@ -17,6 +17,11 @@
   type:     git
   location: git://github.com/k0ral/xml-conduit-parse.git
 
+flag enable-hlint-test
+  description: Enable hlint test-suite
+  manual: True
+  default: False
+
 library
   exposed-modules:
     Data.Conduit.Parser.XML
@@ -44,7 +49,6 @@
     , conduit-parse
     , xml-conduit-parse
     , data-default
-    , hlint
     , parsers
     , resourcet
     , tasty
@@ -52,3 +56,16 @@
     -- , tasty-quickcheck
   default-language:    Haskell2010
   ghc-options: -Wall
+
+test-suite hlint
+  if flag(enable-hlint-test)
+    buildable: True
+  else
+    buildable: False
+  type: exitcode-stdio-1.0
+  main-is: HLint.hs
+  build-depends:
+    base >=4.8,
+    hlint -any
+  default-language: Haskell2010
+  hs-source-dirs: test
