no-empty-file
March 27, 2026 ยท View on GitHub
๐ Disallow empty files.
๐ผ This rule is enabled in the following configs: โ
recommended, โ๏ธ unopinionated.
Meaningless files clutter a codebase.
Disallow any files only containing the following:
- Whitespace
- Comments
- Directives
- Empty statements
- Empty block statements
- Hashbang
Examples
These files fail:
// Comment
/* Comment */
'use strict';
;
{
}
#!/usr/bin/env node
These files pass:
const x = 0;
'use strict';
const x = 0;
;;
const x = 0;
{
const x = 0;
}