Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off Ionide Lint warnings

Tags:

lint

f#

ionide

I have written a F# script in FSI using Ionide in VS Code. It's a great tool, but I am getting a warning from Ionide Lint suggesting a code improvement:

'Lint: Seq.map f (Seq.map g x) might be able to be refactored into Seq.map (g >> f) x.'

I have about 6 Seq.map functions all piped together with |> which I am happy with.

There is also a green wiggly line that is annoying me. I don't agree with the suggestion, and want the wiggly line to go away. How can I tell Ionide to stop making this suggestion?

like image 982
Aidan Avatar asked Mar 10 '23 13:03

Aidan


2 Answers

I have turned off Lint globally in the VS Code settings

"FSharp.linter": false,

I think Ionide uses FsharpLint: http://fsprojects.github.io/FSharpLint/

This supports suppressing of lint messages like this:

[<SuppressMessage("NameConventions", "InterfaceNamesMustBeginWithI")>]
type Printable =
    abstract member Print : unit -> unit

Something like that might work for you as well. I just turned it off.

like image 127
Just another metaprogrammer Avatar answered Mar 28 '23 02:03

Just another metaprogrammer


This is the directive to disable this particular message in code:

open System.Diagnostics.CodeAnalysis
[<SuppressMessage("Hints", "") >]

Place above the block that is producing this 'error'.

like image 20
GunnerGuyven Avatar answered Mar 28 '23 04:03

GunnerGuyven