This page of ReSharper options allows you to manage and configure custom Code Cleanup profiles, as well as to assign a cleanup profile for silent code cleanup.
Note that ReSharper also provides two default cleanup profiles that you cannot modify and that are not displayed on this page: Full Cleanup and Reformat Code,
| Item | Description |
|---|---|
| Custom cleanup profiles | List of available custom code cleanup profiles. See Creating Custom Profiles for more information. |
| Add | Adds a new empty profile, prompting you to specify a name for it. |
| Delete | Deletes the selected profile without prompting for confirmation. |
| Rename | Renames the selected profile. |
| Selected profile settings | Displays code cleanup settings of the selected cleanup profile. |
| Profile to use with silent cleanup | Allows choosing one of the default cleanup profiles or a custom cleanup profile that will be used for silent code cleanup. ReSharper does not make a default selection in this drop-down list, which means that until you select a profile by yourself, ReSharper will open the Code Cleanup dialog box whenever you launch silent code cleanup. |
Code cleanup settings
| Profile setting | Description |
|---|---|
| ASP.NET | |
| Optimize @Register directives | Removes unused @Register directives. |
| HTML | |
| Reformat code | Reformats your code according to options configurable in the Code Editing | HTML | Formatting Style page of ReSharper options. |
| C# | |
| Arrange 'this' qualifier | Applies a rule selected in the Other | Force 'this.' qualifier for instance member drop-down list in the Code Editing | C# | Formatting Style | Other page of ReSharper options and removes redundant this. qualifiers. |
| Remove code redundancies |
In the Code Inspection | Inspection Severity options page ReSharper lists over 70 redundancies that have associated code inspections. Some of them require special attention, and you simply cannot process them in batch mode. That leaves Code Cleanup with about 30 redundancies that it is able to remove automatically whenever you select Remove code redundancies in your cleanup profile. Specifically, Code Cleanup:
|
| Use auto-property, if possible | Replaces simple properties and corresponding backing fields with auto-properties. |
| Make field read-only, if possible | Takes action upon "Field can be made readonly" code inspection item. |
| Use 'var' in declaration |
Provides the following configurable options:
|
| Update file header | Inserts or updates file header that you can configure in the Code Editing | File Header Text options page. |
| Optimize 'using' directives |
Provides the following configurable options:
|
| Shorten qualified references | Replaces fully qualified names with short names where possible by importing namespaces, implementing settings configured in the Code Editing | C# | Namespace Imports options page. |
| Reformat code | Reformats you code according to options configurable in the Code Editing | C# | Formatting Style options pages. |
| Reformat embedded XML doc comments | Reformats XML doc comments according to options configurable in the Code Editing | XML Doc Comments | Formatting Style options page. |
| Reorder type members | Reorders layout of type members according to a pattern configurable in the Code Editing | C# | Type Members Layout options page. |
| VB.NET | |
| Optimize 'import' directives | Removes unused namespace import directives implementing rules configured in the Code Editing | Visual Basic .NET | Namespace Imports options page. |
| Shorten qualified references | Replaces fully qualified names with short names where possible by importing namespaces, implementing settings configured in the Code Editing | Visual Basic .NET | Namespace Imports options page. |
| Reformat code | Reformats your code according to options configurable in the Code Editing | Visual Basic .NET | Formatting Style options pages. |
| JavaScript | |
| Terminates statements | Terminates JavaScript statements with the semicolon. |
| Reformat code |
Reformats your code according to options configurable in the Code Editing | JavaScript | Formatting Style options pages. |
| CSS | |
| Alphabetize properties | Rearranges CSS properties in the alphabetical order. |
| Reformat code | Reformats your code according to options configurable in the Code Editing | CSS | Formatting Style options pages. |
| XML | |
| Reformat code | Reformats your code according to options configurable in the Code Editing | XML | Formatting Style options page. |
Note
ReSharper's settings are saved in settings layers that enable you to have different settings for different solutions as well as to share your settings with your team. To learn more, study the Managing and Sharing Options section.

for details on simple types).