ReSharper 8.0 Web Help

Code Cleanup unites a dozen of ReSharper features, including but not limited to:

  • Code formatting
  • Arranging 'this' qualifier
  • Removing code redundancies
  • Converting properties with backup fields to auto-properties
  • Marking fields as read-only if possible
  • Optimizing namespace import directives
  • Shortening qualified references
  • Inserting and updating file header
  • Replacing explicit types with vars
  • Reordering type members
  • Reformatting embedded XML doc comments

Code Cleanup works in batch mode, so that you can instantly clean the whole project or even solution. That means, you can save a myriad of "go-to-next-highlight-then-apply-a-quick-fix" iterations by simply running Code Cleanup.

There are two default profiles of Code Cleanup: Reformat Code and Full Cleanup.
You cannot change these profiles, however, to adjust code cleanup to your custom requirements, you can create custom cleanup profiles to fit your individual needs. You can also choose a default or custom profile to be used for silent cleanup.

For specific guidelines, see the following topics:

Tip

Code Cleanup settings, including custom profiles, can be shared with fellow developers to ensure uniform look and feel of your code (see Managing and Sharing Options for details).


This feature is supported in the following languages/technologies:

C# VB.NET HTML ASPX Razor JavaScript TypeScript CSS XML XAML RESX Build Scripts
feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available feature_available

Tip

The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see the corresponding topics in the ReSharper by Language section.