5

I got tired of Reshaper complaining on any variables I have named as "varID" to change to Camel Case (i.e. "varId").

So I tried to add a rule in Resharper under

Edit 'Local Variables' Rule Settings

And set the "Name Suffix" with a "ID" and it stopped complaining. Now, if I have a variable as "varID" it will complain and recommend it be renamed to "var". But when I inspect/edit the rules, my original rule is no longer there.

NOTE: I didn't edit the existing rule in case you suggest I check that.

Anyone have any ideas?

pghtech
  • 3,642
  • 11
  • 48
  • 73

2 Answers2

10

I would undo the Name Suffix change. Then go to

Resharper -> Options -> Naming Style (under Languages/Common) and click Advanced Settings.

In the abbreviations list at the bottom is where you want to add ID. Then it should stop complaining about ID being used in variable names, properties, etc.

Brandon
  • 68,708
  • 30
  • 194
  • 223
  • Thank you for this! I was so sick of this too. It was already set up to allow ID in C#, but not JavaScript. I made the change and it worked perfectly. – M.Ob Aug 15 '13 at 14:17
8

If you want to disable 'naming rules':

  • Go to 'Reshaper -> Options -> Code Inspection - > Inspection Severity.
  • Use the search box to search for 'inconsistent naming'.
  • Change the value of the drop-down list to 'Do not show'.
mathijsuitmegen
  • 2,270
  • 1
  • 34
  • 36
  • Thank you. (Annoyingly, attempting to search based on the message given, "Name does not match rule", there was no way to find this. Even just searching for "name" didn't find it. There was no way I could have known that the keyword was "naming"!) – ToolmakerSteve Aug 06 '17 at 12:22
  • Good option also is to change it to hint. – cah1r Aug 29 '17 at 12:59
  • This is a much better way to do it in VB.NET. It is definitely irritating. – John Swaringen May 02 '18 at 18:56
  • Very useful! Since this is relatively old an update: ´do not show´ is no longer an option, you uncheck ´inconsistent naming´ now. – Spikee Apr 11 '19 at 08:54