我创建了Settings.FSharpLint,我想要取消IdentifiersMustNotContainUnderscores
规则
是否可以仅禁用一条规则?
示例(不起作用):
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings>
<Analysers>
<NameConventions>
<IdentifiersMustNotContainUnderscores>
<Enabled>False</Enabled>
</IdentifiersMustNotContainUnderscores>
</NameConventions>
</Analysers>
</FSharpLintSettings>
我试过这个并且效果很好(但它适用于所有NameConventions规则):
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings>
<Analysers>
<NameConventions>
<Enabled>False</Enabled>
</NameConventions>
</Analysers>
</FSharpLintSettings>
答案 0 :(得分:2)
IdentifiersMustNotContainUnderscores
元素需要嵌套在Rules
element中,请尝试:
<?xml version="1.0" encoding="utf-8"?>
<FSharpLintSettings>
<Analysers>
<NameConventions>
<Rules>
<IdentifiersMustNotContainUnderscores>
<Enabled>False</Enabled>
</IdentifiersMustNotContainUnderscores>
</Rules>
</NameConventions>
</Analysers>
</FSharpLintSettings>