Skip to content

Commit 76fa731

Browse files
committed
Add .editorconfig
1 parent 913d9ef commit 76fa731

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.editorconfig

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# EditorConfig is awesome:http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_style = space
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
indent_size = 4
14+
15+
# Xml project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
17+
indent_size = 2
18+
19+
# Xml config files
20+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# JSON files
24+
[*.json]
25+
indent_size = 2
26+
27+
# Dotnet code style settings:
28+
[*.cs]
29+
# Sort using and Import directives with System.* appearing first
30+
dotnet_sort_system_directives_first = true
31+
32+
# Don't use this. qualifier
33+
dotnet_style_qualification_for_field = false:suggestion
34+
dotnet_style_qualification_for_property = false:suggestion
35+
36+
# use int x = .. over Int32
37+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
38+
39+
# use int.MaxValue over Int32.MaxValue
40+
dotnet_style_predefined_type_for_member_access = true:suggestion
41+
42+
# Require var all the time.
43+
csharp_style_var_for_built_in_types = true:suggestion
44+
csharp_style_var_when_type_is_apparent = true:suggestion
45+
csharp_style_var_elsewhere = true:suggestion
46+
47+
# Disallow throw expressions.
48+
csharp_style_throw_expression = false:suggestion
49+
50+
# Newline settings
51+
csharp_new_line_before_open_brace = all
52+
csharp_new_line_before_else = true
53+
csharp_new_line_before_catch = true
54+
csharp_new_line_before_finally = true
55+
csharp_new_line_before_members_in_object_initializers = true
56+
csharp_new_line_before_members_in_anonymous_types = true

Razor.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.
1414
EndProject
1515
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F8C12DD6-659D-405A-AA27-FB22AD92A010}"
1616
ProjectSection(SolutionItems) = preProject
17+
.editorconfig = .editorconfig
1718
build\common.props = build\common.props
1819
NuGet.config = NuGet.config
1920
EndProjectSection

0 commit comments

Comments
 (0)