emptyFiles
Reports files that contain no meaningful code.
✅ This rule is included in the tsstylisticandstylisticStrictpresets.
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.
Examples
Section titled “Examples”// This file is empty"use strict";{}export const value = 1;import { something } from "module";function getValue() { return 42;}"use strict";const x = 1;Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”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.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
unicorn/no-empty-file - Oxlint:
unicorn/no-empty-file
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.