Skip to content

Commit

Permalink
feat(eslint-config): add rule no-enum (#2463)
Browse files Browse the repository at this point in the history
* feat(eslint-config): add rule no-enum

* chore(eslint-config): change no-enum to warning
  • Loading branch information
alber70g committed Aug 20, 2024
1 parent 8e1c963 commit abe3ec7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-cheetahs-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kadena-dev/eslint-config': minor
---

Disallow `enum`, use `<Record<string, string|number>>{} as const` instead.
7 changes: 7 additions & 0 deletions packages/tools/eslint-config/profile/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ module.exports = {
],
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'@rushstack/typedef-var': 'off',
'no-restricted-syntax': [
'warn',
{
selector: 'TSEnumDeclaration',
message: 'Use `Record<string, string|number>` with `as const` instead.',
},
],
},
settings: {
'import/parsers': {
Expand Down

0 comments on commit abe3ec7

Please sign in to comment.