9

我收到了 ReSharper 警告,我想在这种特殊情况下禁止该警告(但不是针对整个项目)。目前唯一的方法是用评论压制它。不过看起来很丑!

// ReSharper disable StaticFieldInGenericType
        private static int count;
// ReSharper restore StaticFieldInGenericType

我只是不喜欢在我的代码中看到这些 ReSharper 注释。

是否有可能将这些设置保存在单独的文件中,例如 -SupressedInspections.ReSharper等?

4

1 回答 1

8

不,您只能在评论中禁用它。您可以做的最好的事情是使用 ReSharper 8 的简洁版,单行版本:

// ReSharper disable once StaticFieldInGenericType
于 2013-12-06T08:42:43.387 回答