FSharpLint, how to use the rule “InterfaceNamesMustBeginWithI” in SuppressMessageAttribute?

寵の児 提交于 2019-12-11 07:26:53

问题


[<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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!