Skip to content

no-empty-keys

all languagessuspiciousno fixdefault: off

Reports a key that is empty or only white space after decoding escapes ("": 4).

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.

Reported
{"": 1, " \t": 2, "a": 3, "\u0020": 4}
lint:
rules:
no-empty-keys: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line no-empty-keys in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
Biome suspicious/noEmptyObjectKeys full