Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 885 Bytes

no-empty-fields.md

File metadata and controls

37 lines (29 loc) · 885 Bytes

no-empty-fields

💼 This rule is enabled in the ✅ recommended config.

💡 This rule is manually fixable by editor suggestions.

This rule flags all empty arrays and objects in a package.json, as such empty expressions do nothing, and are often the result of a mistake. It will report both named properties that are empty, as well as nested arrays and objects that are empty.

Example of incorrect code for this rule:

{
	"main": "lib/index.js",
	"scripts": {},
	"files": [],
	"simple-git-hooks": {
		"pre-commit": "pnpm exec nano-staged --allow-empty",
		"preserveUnused": []
	}
}

Example of correct code for this rule:

{
	"main": "lib/index.js",
	"simple-git-hooks": {
		"pre-commit": "pnpm exec nano-staged --allow-empty"
	}
}