no-empty-fields
July 9, 2026 ยท View on GitHub
๐ Disallow empty fields.
๐ผ This rule is enabled in the โ
recommended config.
๐ก This rule is manually fixable by editor suggestions.
Empty objects ({}), arrays ([]), and strings ("") in package.json are almost always leftovers from refactoring or scaffolding. They add noise and can be misleading.
Use the ignore option to allow specific fields where an empty value is meaningful (for example, "files": []).
Options
ignore
Type: string[]
Default: []
Field names to skip.
{
'package-json/no-empty-fields': ['error', {ignore: ['files']}]
}
Examples
// โ
{
"keywords": []
}
// โ
{
"scripts": {}
}
// โ
{
"keywords": ["cli", "tool"]
}