Skip to content

emptyFiles

Reports files that contain no meaningful code.

✅ This rule is included in the ts stylistic and stylisticStrict presets.

Empty files clutter a codebase and often serve no purpose. Files containing only whitespace, comments, directives (like "use strict"), or empty statements are considered empty and should either contain meaningful code or be deleted.

// This file is empty
"use strict";
{
}

This rule is not configurable.

If you intentionally keep placeholder files in your codebase (e.g., as part of scaffolding or to reserve file names), you may want to disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.