问题
[<SuppressMessage("NameConventions","InterfaceNamesMustBeginWithI")>] //No effect
[<SuppressMessage("NameConventions","InterfaceNames")>] //It's working
module Test=
type [<AllowNullLiteral>] MutationEvent =
abstract attrChange: float with get, set
...
Also, failed to search source code about "InterfaceNamesMustBeginWithI".
回答1:
The name of the rule is InterfaceNames
, so you can suppress it thus:
[<SuppressMessage("","InterfaceNames")>]
module Test =
...
Also note that the first argument to SuppressMessage
is not used by fsharplint, so it can be anything (although not null
, strangely enough!)
There are pointers to InterfaceNamesMustBeginWithI
in the documentation, but this is not correct.
来源:https://stackoverflow.com/questions/57240886/fsharplint-how-to-use-the-rule-interfacenamesmustbeginwithi-in-suppressmessag