New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XS✔ ◾ Typescript Enums Rule #8193
Conversation
PR Metrics✔ Thanks for keeping your pull request small.
Metrics computed by PR Metrics. Add it to your Azure DevOps and GitHub PRs! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to dig a bit more on when to use enum in the code, and when to use const object.
My thoughts: collection of values in a const is not an enum - they are separate use cases and for different purpose 😄
Also see https://www.typescriptlang.org/docs/handbook/enums.html#objects-vs-enums and https://github.com/rbuckton/proposal-enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved with suggestions
Formatted enum Co-authored-by: Matt Wicks [SSW] <wicksipedia@users.noreply.github.com>
Reworded phrasing Co-authored-by: Matt Wicks [SSW] <wicksipedia@users.noreply.github.com>
…ing/SSW.Rules.Content into typescript-enums-rule
…ing/SSW.Rules.Content into typescript-enums-rule
On leave in a different timezone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tip: Use SSW Rule Writer GPT for help with writing rules 🤖
✏️ There have been some duplication issues with enums on the SSW.Website, thought its important for people to understand const assertions.
✏️ Added a new rule: Do you know the pitfalls of TypeScript enums?
✏️ No