Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 734 Bytes

no-empty-file.md

File metadata and controls

70 lines (51 loc) · 734 Bytes

Disallow empty files

💼 This rule is enabled in the ✅ recommended config.

Meaningless files clutter a codebase.

Disallow any files only containing the following:

  • Whitespace
  • Comments
  • Directives
  • Empty statements
  • Empty block statements
  • Hashbang

Fail

// Comment
/* Comment */
'use strict';
;
{
}
#!/usr/bin/env node

Pass

const x = 0;
'use strict';
const x = 0;
;;
const x = 0;
{
	const x = 0;
}