How can I get Visual Studio to give me a naming warning each time I create an asynchronous method that doesn't end in "Async"?
It's the recommended convention for asynchronous methods, but I often find myself forgetting to add that suffix and a warning would be useful.
From Options,
In addition to Visual Studio Text Editor Settings, you can create portable, custom editor settings
.editorconfig
file. Visual Studio 2017 natively supports.editorconfig
files.By creating the
.editorconfig
file as part of the repository and pushing it to the repository, you can enforce consistent coding styles for everyone that works in that codebase, regardless of their Visual Studio Text Editor Settings.To do so:
In the Solution Explorer, select the Solution, Project or a folder in the project, depending on the scope which you want to apply the naming rule.
Right click and select Add New Item or Press Ctrl + Shift + A
.editorconfig
as file name.Note: The file location can be even in parent folder of your solution. It's not necessary to have it in solution.
Paste the following content in the file:
More Information: