-
Notifications
You must be signed in to change notification settings - Fork 22
EditorConfig Rule Evaluation
This page is by no means intended to replace the official EditorConfig documentation, however there are a few key points with combinations of specific rules that your should be aware of.
For a full listing of all valid properties, please check the official EditorConfig properties list wiki page.
Either of the following two rulesets will indent code with a tab width of 4 characters:
Ruleset 1:
indent_style = tab
tab_width = 4Ruleset 2:
indent_style = tab
indent_size = 4Note: The
tab_widthproperty relies on theindent_style = tabproperty.
Because indent_style defaults to space, all three of the following rulesets are considered valid.
Ruleset 1:
Will indent code with 2 space characters:
indent_style = space
indent_size = 2Ruleset 2:
Will indent code with 4 space characters:
tab_width = 4Ruleset 3:
Will indent code with 8 space characters:
indent_size = 8Note: Even though the
indent_styleproperty defaults tospace, it is recommended to set these explicitly in your rulesets. This will remove any ambiguity with regards to how the code will be formatted.