Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 349 Bytes

no-const-enum.md

File metadata and controls

16 lines (11 loc) · 349 Bytes

no-const-enum

Avoid using const enums. These can't be used by JavaScript users or by TypeScript users with --isolatedModules enabled.

Bad:

const enum Bit { Off, On }
export function f(b: Bit): void;

Good:

export function f(b: 0 | 1): void;