no-empty-keys
all languagessuspiciousno fixdefault: off
What it does
Section titled “What it does”Reports a key that is empty or only white space after decoding escapes ("": 4).
Why it matters
Section titled “Why it matters”A property with no name cannot be reached the usual ways: a dotted path, a command line option or an environment variable has no spelling for it, and some consumers fail on it. It is nearly always a missing name.
To fix, give the key a name.
Example
Section titled “Example”{"": 1, " \t": 2, "a": 3, "\u0020": 4}Configuration
Section titled “Configuration”lint: rules: no-empty-keys: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line no-empty-keys in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| Biome | suspicious/noEmptyObjectKeys |
full |