web: Disallow non-const TypeScript enums

They generate unnecessary code.
This commit is contained in:
relrelb 2022-01-16 17:04:17 +02:00 committed by Mike Welsh
parent 479719f425
commit 2f1cb9f655
1 changed files with 6 additions and 0 deletions

View File

@ -22,3 +22,9 @@ overrides:
'@typescript-eslint/no-unused-vars': '@typescript-eslint/no-unused-vars':
- error - error
- argsIgnorePattern: ^_ - argsIgnorePattern: ^_
# Disallow non-const enums, as they generate unnecessary code.
# Taken from https://github.com/typescript-eslint/typescript-eslint/issues/561#issuecomment-593059472.
no-restricted-syntax:
- error
- selector: 'TSEnumDeclaration:not([const=true])'
message: Don't declare non-const enums