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

[5.3] Type error in typescript.d.ts with exactOptionalPropertyTypes = true #56478

Closed
uid11 opened this issue Nov 21, 2023 · 1 comment Β· Fixed by #56489
Closed

[5.3] Type error in typescript.d.ts with exactOptionalPropertyTypes = true #56478

uid11 opened this issue Nov 21, 2023 · 1 comment Β· Fixed by #56489
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@uid11
Copy link

uid11 commented Nov 21, 2023

πŸ”Ž Search Terms

"exactOptionalPropertyTypes", "JsDocParsingMode".

πŸ•— Version & Regression Information

⏯ Playground Link

No response

πŸ’» Code

// "exactOptionalPropertyTypes": true,

import type { CompilerOptions } from "typescript";

export type { CompilerOptions };

πŸ™ Actual behavior

Error:

node_modules/typescript/lib/typescript.d.ts:3287:24 - error TS2420: Class 'Project' incorrectly implements interface 'LanguageServiceHost'.
  Types of property 'jsDocParsingMode' are incompatible.
    Type 'JSDocParsingMode | undefined' is not assignable to type 'JSDocParsingMode'.
      Type 'undefined' is not assignable to type 'JSDocParsingMode'.

3287         abstract class Project implements LanguageServiceHost, ModuleResolutionHost {
                            ~~~~~~~


Found 1 error in node_modules/typescript/lib/typescript.d.ts:3287

πŸ™‚ Expected behavior

No error.

Additional information about the issue

Minimal repository with bug reproduction: https://github.com/uid11/jsDocParsingMode-error-example.

As far as I can see, to fix this error, it is enough to replace the line

jsDocParsingMode?: JSDocParsingMode;

with

    jsDocParsingMode?: JSDocParsingMode | undefined;

Although, perhaps, such errors with exactOptionalPropertyTypes are corrected differently.

@uid11 uid11 changed the title Type error in typescript.d.ts with exactOptionalPropertyTypes = true [5.3] Type error in typescript.d.ts with exactOptionalPropertyTypes = true Nov 21, 2023
@jakebailey jakebailey self-assigned this Nov 21, 2023
@andrewbranch andrewbranch added the Needs Investigation This issue needs a team member to investigate its status. label Nov 21, 2023
@jakebailey
Copy link
Member

Working on this; there are more errors than just this one.

@jakebailey jakebailey added this to the TypeScript 5.3.3 milestone Nov 21, 2023
yaacovCR added a commit to yaacovCR/stitch that referenced this issue Nov 24, 2023
temporarily blocked from TS 5.3.2 secondary to

microsoft/TypeScript#56478

fix expected in 5.3.3
yaacovCR added a commit to yaacovCR/stitch that referenced this issue Nov 24, 2023
temporarily blocked from TS 5.3.2 secondary to

microsoft/TypeScript#56478

fix expected in 5.3.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
3 participants