Comment style#
Use # for comments.
Before ❌
! You are reading a commentAfter ✅
# You are reading a commentComment trimming#
Empty comments at the beginning or end of a comment block with content must be removed. Empty comments between non-empty comments are allowed as separators. A block containing only empty comments is handled by no-empty-comment.
Before ❌
#
# one
#After ✅
# oneNo empty comment#
Comment blocks must have content. A block containing only empty comments is invalid. If a block contains at least one non-empty comment, leading or trailing empty comments are handled by comment-trimming, and interior empty comments are allowed as separators.
Before ❌
#
#After ✅
No dangling continuation#
Files cannot end with a dangling line continuation. A backslash (\) at the
end of a line continues the entry onto the next line, so it must be followed by
one.
Before ❌
multiline=line1\
escape=this is backslash \After ✅
multiline=line1\
line2
escape=this is backslash \\Separator style#
Entries must use = as the key/value separator.
Before ❌
key:valueAfter ✅
key=valueValid escape#
Entries must have valid escape sequences. For example, unicode escapes must
include four hexadecimal digits (\u1234, not \u123).
Before ❌
unicode=\u123After ✅
unicode=\u1234Key name#
Keys can follow snake_case, camelCase or kebab-case, but not UPPERCASE.
Before ❌
ITEM=value
DATABASE_USER=adminAfter ✅
item=value
database.user=adminKey order#
Keys must be in alphabetical order, case-insensitively.
Before ❌
item2=value
item1=valueAfter ✅
item1=value
item2=valueNo duplicate key#
Duplicate keys are not allowed.
Before ❌
item=value
item=otherAfter ✅
item1=value
item2=otherNo empty key#
Keys cannot be empty.
Before ❌
=valueAfter ✅
item=valueNo empty value#
Values cannot be empty.
Before ❌
item=After ✅
item=valueEntry trimming#
Keys and values cannot have leading or trailing whitespace.
Before ❌
item = valueAfter ✅
item=valueNo duplicate blank line#
Consecutive blank lines are not allowed.
Before ❌
item1=value
item2=otherAfter ✅
item1=value
item2=otherNo leading blank line#
File cannot start with a blank line.
Before ❌
item=valueAfter ✅
item=valueTrailing newline#
File must end with a newline character.
Before ❌
item=valueAfter ✅
item=value
↵
Comment spacing#
Comments must have no leading whitespace and exactly one space after
#.Before ❌
After ✅