Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off certain hlint rules in vscode

I have the following Visual Studio Code extensions for Haskell installed:

enter image description here

If I use elem in a prefix form:

(elem n primes)

I get a blue squiggly that suggests the infix form:

enter image description here

Is there a way to turn off just this particular hlint rule, hlint(refact:Use infix) just for this file or project?

like image 650
dharmatech Avatar asked Sep 11 '25 17:09

dharmatech


1 Answers

Yes!

For a single source file, add one of these to the top of the file:

{-# ANN module "HLint: ignore Use infix" #-}

{-# HLINT ignore "Use infix" #-}

{- HLINT ignore "Use infix" -}

For the entire project, create a file .hlint.yaml as follows:

- ignore: {name: Use infix}

You can also run hlint --default > .hlint.yaml from a terminal, which will create a .hlint.yaml file ignoring any hints currently uncorrected in your project.

These are not VS Code specific - they apply wherever hlint is used.

For more information see the HLint manual.

Happy Haskelling!

like image 96
Ari Fordsham Avatar answered Sep 14 '25 08:09

Ari Fordsham