Code Cleanup is available in JavaScript as well. Thus you are not supposed to organise your code manually, ReSharper will do that for you!
You can apply Code Cleanup to a selected block of code, to the opened file or to a number of files. To learn how to apply
Code Cleanup to a desired scope, see
Code Cleanup provides two default profiles - Full Cleanup and Reformat Code - you can use one of them or create
| Action | Full Cleanup | Reformat Code |
|
Terminate statements |
|
|
|
Reformat Code |
|
|
ReSharper reformats code according to settings configured in:
- ReSharper | Options | Code Editing | JavaScript | Formatting Style | Braces Layout
- ReSharper | Options | Code Editing | JavaScript | Formatting Style | Line Breaks
- ReSharper | Options | Code Editing | JavaScript | Formatting Style | Spaces
- ReSharper | Options | Code Editing | JavaScript | Formatting Style | Other
Consider the example below. Before Code Cleanup:
After:
