emptyEnums
Reports empty enum declarations with no members.
✅ This rule is included in the ts logical presets.
An enum with no members serves no purpose. Empty enums cannot be used to represent any values and are typically the result of incomplete implementation or accidental deletion.
Examples
Section titled “Examples”enum Status {}export enum Direction {}const enum Color {}enum Status { Active, Inactive,}export enum Direction { North, South, East, West,}const enum Color { Red = 1, Green = 2, Blue = 3,}Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If you are in the middle of implementing an enum and prefer to define the structure before adding members, you may want to temporarily disable this rule. Some codebases use empty enums as placeholder types during development.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- Deno:
no-empty-enum
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.