no-empty-enum
NOTE: this rule is part of the
recommended rule set.Enable full set in
deno.json:{
"lint": {
"rules": {
"tags": ["recommended"]
}
}
}Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include or exclude array in deno.json:{
"lint": {
"rules": {
"include": ["no-empty-enum"],
"exclude": ["no-empty-enum"]
}
}
}Disallows the declaration of an empty enum.
An enum with no members serves no purpose. This rule will capture these situations as either unnecessary code or a mistaken empty implementation.
Invalid:
enum Foo {}
Valid:
enum Foo {
ONE = "ONE",
}