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"]
}