-
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 = 4
Ruleset 2:
indent_style = tab
indent_size = 4
Note: The
tab_width
property relies on theindent_style = tab
property.
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 = 2
Ruleset 2:
Will indent code with 4 space characters:
tab_width = 4
Ruleset 3:
Will indent code with 8 space characters:
indent_size = 8
Note: Even though the
indent_style
property 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.