Skip to content
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

Add literals alongside enums #1016

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

theorm
Copy link

@theorm theorm commented Mar 29, 2024

Generating literal types alongside string and int Enums. We really need it in our code so have this in our custom templates. I thought there are others who would like to have it in the default template.

@dbanty
Copy link
Collaborator

dbanty commented Apr 19, 2024

Are you using literals instead of enums? Is there a particular limitation of enums that makes that necessary? Trying to understand if this should be an option in config (to generate literals instead) or if it makes sense to completely replace enums with literals 🤔

@theorm
Copy link
Author

theorm commented Apr 27, 2024

We are using literals instead of enums in a public library with a lot of choice parameters where having enums would mean a lot of typing for the user and generally more noise in the code. There are still many developers out there who prefer to use enums instead of literals, so making it configurable would be a much better option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants