ardatan/feTS

Enable "exactOptionalPropertyTypes": true, in tsconfig.json

JustFly1984 opened this issue · 3 comments

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!

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

Feel free to creat a PR

#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

Created #407 PR instead of #404