refactor(core): Forbid raw enums (no-changelog)

This commit is contained in:
Michael Kret
2023-04-21 14:23:15 +03:00
committed by GitHub
parent da31925083
commit 0e93fe064e
39 changed files with 119 additions and 115 deletions

View File

@@ -397,6 +397,18 @@ const config = (module.exports = {
},
],
/**
* https://www.typescriptlang.org/docs/handbook/enums.html#const-enums
*/
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration:not([const=true])',
message:
'Do not declare raw enums as it leads to runtime overhead. Use const enum instead. See https://www.typescriptlang.org/docs/handbook/enums.html#const-enums',
},
],
// ----------------------------------
// import
// ----------------------------------