Skip to content

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

@JustFly1984

Description

@JustFly1984

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions