1.nuget中安装 StyleCop.Analyzers
当前版本1.1.0-beta004
2.在项目根目录新增 stylecop.json文件
{
"settings": {
"orderingRules": {
"usingDirectivesPlacement": "insideNamespace"
}
}
}
3.右键项目文件点击编辑proj增加
<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
4.最后效果
如何在netcore中使用参见
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/DotNetCli.md
如何配置stylecop.json
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/Configuration.md
本篇完