Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 842 Bytes

no-const-enum.md

File metadata and controls

25 lines (17 loc) · 842 Bytes

Avoid const enum declarations (no-const-enum)

This rule forbids const enum declarations. Programs that use const enum declarations cannot be compiled using without fully checking the program's types. That means they are not compatible with TypeScript's transpileModule function nor can they be transpiled with Babel.

Options

This rule accepts a single option which is an object with an allowLocal property that determines whether local - i.e. non-exported - const enums are allowed. By default, they are not.

{
  "etc/no-const-enum": [
    "error",
    { "allowLocal": true }
  ]
}

Related to

Further reading