Comment style#
Use # for comments.
Before ❌
! You are reading a commentAfter ✅
# You are reading a commentInvalid escape#
Entries with invalid escape sequences. This includes short unicode escapes (e.g.
\u123), invalid octal escapes (e.g. \8), and invalid single-character
escapes (e.g. \x).
Before ❌
unicode=\u123After ✅
unicode=\u1234Missing separator#
Entries must have either = or : separators.
Before ❌
key valueAfter ✅
key=valueUnterminated line continuation#
Entries with unterminated line continuations. Line continuations must end with a
backslash (\) followed by a newline.
Before ❌
multiline=line1\
escape=this is backslash \After ✅
multiline=line1\
line2
escape=this is backslash \\Duplicate key#
Duplicate keys are not allowed.
Before ❌
item=value
item=otherAfter ✅
item1=value
item2=otherKey name#
Keys can follow snake_case, camelCase or kebab-case, but not UPPERCASE.
Before ❌
ITEM=value
DATABASE_USER=adminAfter ✅
item=value
database.user=adminMissing key#
Entries must have a key.
Before ❌
=valueAfter ✅
item=valueMissing value#
Entries must have a value.
Before ❌
item=After ✅
item=valueDuplicate blank line#
Multiple 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
↵Untrimmed entry#
Entries cannot have leading or trailing whitespace in keys or values.
Before ❌
item = valueAfter ✅
item=value
Comment spaces#
Comments must have no space before and exactly one space after
#.Before ❌
After ✅