Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 538 Bytes

no-empty-file.md

File metadata and controls

66 lines (48 loc) · 538 Bytes

Disallow empty files.

Meaningless files clutter a codebase. Disallow any file containing absolutely nothing, only whitespace, only comments, only a 'use strict'; statement, or empty statements.

This rule is not fixable.

Fail

\n
\r
\r\n
// comment
/* comment */
'use strict';
;
{}

Pass

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