rust-lang / rust-lang/rust-analyzer

editor/code: Enable TypeScript's `--exactOptionalPropertyTypes`

Open
#15,253 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vscode C-enhancement
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

This issue proposes to enable TS' --exactOptionalPropertyTypes option.

To enable this option,

  • npm:@types/vscode chages their optional property types to accept undefined (e.g. bar?: Foo should be bar?: Foo | undefined if there is no problem).
  • Or we need to change our code to avoid to assign undefined to properties as marked as optional.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the editor/code TypeScript configuration and the code that assigns undefined to optional properties. Check the linked TypeScript option and the @types/vscode examples in the issue, then determine whether enabling the option requires updated dependency types or code changes; done means the option is enabled without type errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.