The table below lists Code Cleanup settings for all supported languages (C#, VB.NET, JavaScript, XML, HTML, CSS, ASP.NET).
You can edit these settings for custom code cleanup profiles.
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 ReSharper | Options | Code Editing | HTML for HTML code. |
|
C# | |
|
Arrange 'this' qualifier |
Applies a value selected in the ReSharper | Options | Code Editing | C# | Formatting Style | Other | Other | Force "this." qualifier for instance member drop-down list and removes redundant this. qualifiers. |
|
Remove code redundancies |
Overall, ReSharper lists over 70 redundancies in ReSharper | Options | Code Inspection | Inspection Severity that have associated code inspection items. Some of them require special attention, and you simply can't 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 three options: Replace direction, 'foreach' iterator declaration style, and Local variable declaration style (see below). |
|
Replace direction |
One of three items in the Use 'var' in declaration group of settings. Provides four options:
|
|
'foreach' iterator declaration style |
One of three items in the Use 'var' in declaration group of settings. Provides three options:
|
|
Local variable declaration style |
One of three items in the Use 'var' in declaration group of settings. Provides five options:
|
|
Update file header |
Inserts or updates file header that you can specify in the ReSharper | Options | Code Editing | File Header Text tab. |
|
Optimize 'using' directives |
One of three items in the Optimize 'using' directives group of settings. Removes unused namespace import directives; implements settings configured in the ReSharper | Options | Code Editing | C# | Namespace Imports tab. |
|
Embrace 'using' directives in region |
One of three items in the Optimize 'using' directives group of settings. In every file that a particular Cleanup action covers, this setting creates a new region for holding all namespace import directives. |
|
Region name |
One of three items in the Optimize 'using' directives group of settings. Allows to specify a name for the namespace import region. |
|
Shorten qualified references |
Replaces fully qualified names with short names where possible by importing namespaces, implementing settings configured in the ReSharper | Options | Code Editing | C# | Namespace Imports tab. |
|
Reformat code |
Reformats you code according to options configurable in ReSharper | Options | Code Editing | C# | Formatting Style for C# code. |
|
Reformat embedded XML doc comments |
Reformats XML doc comments according to options configurable in ReSharper | Options | Code Editing | XML | Formatting Style. |
|
Reorder type members |
Reorders type members according to a pattern configurable in ReSharper | Options | Code Editing | C# | Type Members Layout. |
|
VB.NET | |
|
Optimize 'import' directives |
Removes unused namespace import directives; implements settings configured in the ReSharper | Options | Code Editing | Visual Basic .NET | Namespace Imports tab. |
|
Shorten qualified references |
Replaces fully qualified names with short names where possible by importing namespaces, implementing settings configured in the ReSharper | Options | Code Editing | Visual Basic .NET | Namespace Imports tab. |
|
Reformat code |
Reformats your code according to options configurable in ReSharper | Options | Code Editing | Visual Basic .NET | Formatting Style for VB.NET code. |
|
JavaScript | |
|
Terminates statements |
Terminates JavaScript statements with the semicolon. |
|
Reformat code |
Reformats your code according to options configurable in ReSharper | Options | Code Editing | JavaScript | Formatting Style for XML code. |
|
CSS | |
|
Alphabetize properties |
Rearranges CSS properties in the alphabetical order. |
|
Reformat code |
Reformats your code according to options configurable in ReSharper | Options | Code Editing | CSS | Formatting Style for XML code. |
|
XML | |
|
Reformat code |
Reformats your code according to options configurable in ReSharper | Options | Code Editing | XML | Formatting Style for XML code. |

for details
on simple types).