eslint-plugin-etc
Version:
More general-purpose ESLint rules
25 lines (17 loc) • 842 B
Markdown
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.
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.
```json
{
"etc/no-const-enum": [
"error",
{ "allowLocal": true }
]
}
```
- [`no-enum`](./no-enum.md)
- [const enums](https://www.typescriptlang.org/docs/handbook/enums.html#const-enums)
- [Don’t Export const enums](https://ncjamieson.com/dont-export-const-enums/)
This rule forbids `