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

Enable "exactOptionalPropertyTypes": true, in tsconfig.json #402

Open
JustFly1984 opened this issue Jul 28, 2023 · 3 comments
Open

Enable "exactOptionalPropertyTypes": true, in tsconfig.json #402

JustFly1984 opened this issue Jul 28, 2023 · 3 comments

Comments

@JustFly1984
Copy link

Is your feature request related to a problem? Please describe.

@beerose I watched a youtube video, and it looks like fets is perfect for the project we are starting. Thank you for a great work!

Our project enabled "exactOptionalPropertyTypes": true, can you please enable this rule in fets?

essen

Describe the solution you'd like

Essentially it will require to add | undefined to every optional property across project types, except those which has default values.

Describe alternatives you've considered

Sometimes it requires to do extra data manipulations or type casting while using TS libraries without exactOptionalPropertyTypes enabled.
In my experience with code generation for graphql schema before, I had noticed that generated types could have undefined values, and passing it down to optional props could cause typescript false negatives, like you can't pass undefined to optional prop, if exactOptionalPropertyTypes disabled in consumer project.

Additional context

If you agree, I can create a PR.

Have a great day!

@beerose
Copy link
Collaborator

beerose commented Jul 28, 2023

I think your proposal makes a lot of sense! Thanks!

Feel free to creat a PR

@JustFly1984
Copy link
Author

#404

@beerose I left a lot of comments in places where I found appropriate. If you want me to change something or remove any comments, feel free to ping me in twitter @JustFly1984

@JustFly1984
Copy link
Author

Created #407 PR instead of #404

@TuvalSimha TuvalSimha reopened this Aug 4, 2023
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

No branches or pull requests

3 participants