Closed
Description
π Search Terms
"exactOptionalPropertyTypes", "JsDocParsingMode".
π Version & Regression Information
- This changed between versions 5.2.2 and 5.3.2
- I think, this changed in commit or PR Make JSDoc skipping public, plus more configurableΒ #55739
β― 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
TypeScript/src/services/types.ts
Line 435 in c266e47
with
jsDocParsingMode?: JSDocParsingMode | undefined;
Although, perhaps, such errors with exactOptionalPropertyTypes
are corrected differently.