In the ReSharper options, find the Import Namespace page under C # → Formatting Style. In it, check the box next to "Add usage directive to the largest area."
Then go to the bottom "Tools" section and select the "Clear Code" page. Create a new cleaning profile and check the "Embrace" box using the "directives in the region" option, setting "Using Statement" as the name of the region on the next line. Make sure that "Optimize" using the "directives" is checked. You can enable or disable other cleaning settings as you like.
Then you can start cleaning the code in the file by pressing Ctrl + E , C (or Ctrl + E , F if you set this profile as your silent clean -up).
source share