Enable "exactOptionalPropertyTypes": true, in tsconfig.json
- Dominant language
- TypeScript
- Stars
- 719
- Forks
- 33
- Avg merge
- 5h 46m
- Merged PRs (30d)
- 60
Description
**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!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with tsconfig.json and inspect the project’s TypeScript type definitions for optional properties. Review which properties have defaults and check the resulting type errors after enabling the requested compiler option. Done means the option is enabled and the project’s TypeScript checks pass without incorrect optional-property assignments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100