Skip to content

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 ​

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

Pass ​

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

Released under the Apache License 2.0.