Cleaning up code with CodeMaid
CodeMaid VS2022, by Steve Cadwallader, is an amazing extension that helps us simplify and clean up code. It is free and compatible with C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript, and TypeScript.
To install CodeMaid, type codemaid
in the search bar of the Extensions window, as shown in Chapter 11, Working with Extensions in Visual Studio, and install the CodeMaid VS2022 version.
After installing CodeMaid, you will see a new option in the Extensions menu that contains all the functionalities and configurations related to CodeMaid (see Figure 12.4):
Figure 12.4 – The new CodeMaid option in the Extensions menu
For this demonstration, I’m going to use a new project with the ASP.NET Core Web App (Razor Pages) template. When there is no active document, many options are disabled, as shown in Figure 12.4; however, we can use the Cleanup All Code… option...