首页 新闻 会员 周边

如何通过 editorconfig 消除 'Use "Async" suffix in names of methods that return an awaitable type'

0
悬赏园豆:30 [已解决问题] 解决于 2023-12-24 14:10

不管在 visual studio 还是在 vscode 中,如果 async 异步方法名没有以 Async 结尾,都会出现代码风格警告:

Use "Async" suffix in names of methods that return an awaitable type (VSTHRD200)

请问如何通过 .editorconfig 禁用这个警告?

问题补充:

在代码编辑器出现的代码风格提示不是 Warning,是 Info,这个检查规则来自 Cnblogs.CodeQuality.ruleset

<Rule Id="VSTHRD200" Action="Info" />
dudu的主页 dudu | 高人七级 | 园豆:30943
提问于:2023-12-24 10:46
< >
分享
最佳答案
0

终于通过 Convert an existing Ruleset file to EditorConfig file 找到了解决方法,在 .editorconfig 中添加下面的规则:

[*.cs]
dotnet_diagnostic.VSTHRD200.severity = none
dudu | 高人七级 |园豆:30943 | 2023-12-24 14:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册