Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let Resharper force this keyword on fields

Does anyone know if it is possible to have resharper force the use of the this keyword when it can be used? For fields and such...

Resharper is capable of showing where it can be removed, but our coding standard tells us to use the this keyword.

like image 700
Sorskoot Avatar asked Nov 03 '10 13:11

Sorskoot


2 Answers

In ReSharper Options, under Code Editing -> C# -> Code Style there is an option for Use "this." qualifier for that you can set for fields, properties, events, and methods.

like image 58
bdukes Avatar answered Sep 20 '22 14:09

bdukes


Checkout the StyleCop for Resharper plugin (part of the StyleCop project).

You can then set the "default" severity for StyleCop to Error (or just this particular rule) and it will appear in the R# "files with errors" area inside Visual Studio.

like image 44
Brett Veenstra Avatar answered Sep 21 '22 14:09

Brett Veenstra