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

Cherry-pick #56489 into release-5.3 #56490

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7404,7 +7404,7 @@ export interface CommandLineOptionBase {
isFilePath?: boolean; // True if option value is a path or fileName
shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help'
description?: DiagnosticMessage; // The message describing what the command line switch does.
defaultValueDescription?: string | number | boolean | DiagnosticMessage; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
defaultValueDescription?: string | number | boolean | DiagnosticMessage | undefined; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n.
paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter
isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file
isCommandLineOnly?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
readonly realpath?: (path: string) => string;

/** @internal */
hasInvalidatedResolutions: HasInvalidatedResolutions | undefined;
hasInvalidatedResolutions?: HasInvalidatedResolutions | undefined;

/** @internal */
hasInvalidatedLibResolutions: HasInvalidatedLibResolutions | undefined;
Expand Down
8 changes: 4 additions & 4 deletions src/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR
*/
readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
realpath?(path: string): string;
/** @internal */ createHash?(data: string): string;
/** @internal */ createHash?: ((data: string) => string) | undefined;

/*
* Unlike `realpath and `readDirectory`, `readFile` and `fileExists` are now _required_
Expand Down Expand Up @@ -390,9 +390,9 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR
* If provided along with custom resolveLibrary, used to determine if we should redo library resolutions
* @internal
*/
hasInvalidatedLibResolutions?(libFileName: string): boolean;
hasInvalidatedLibResolutions?: ((libFileName: string) => boolean) | undefined;

/** @internal */ hasInvalidatedResolutions?: HasInvalidatedResolutions;
/** @internal */ hasInvalidatedResolutions?: HasInvalidatedResolutions | undefined;
/** @internal */ hasChangedAutomaticTypeDirectiveNames?: HasChangedAutomaticTypeDirectiveNames;
/** @internal */ getGlobalTypingsCacheLocation?(): string | undefined;
/** @internal */ getSymlinkCache?(files?: readonly SourceFile[]): SymlinkCache;
Expand Down Expand Up @@ -429,7 +429,7 @@ export interface LanguageServiceHost extends GetEffectiveTypeRootsHost, MinimalR
/** @internal */ onReleaseParsedCommandLine?(configFileName: string, oldResolvedRef: ResolvedProjectReference | undefined, optionOptions: CompilerOptions): void;
/** @internal */ getIncompleteCompletionsCache?(): IncompleteCompletionsCache;

jsDocParsingMode?: JSDocParsingMode;
jsDocParsingMode?: JSDocParsingMode | undefined;
}

/** @internal */
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10416,7 +10416,7 @@ declare namespace ts {
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
writeFile?(fileName: string, content: string): void;
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
jsDocParsingMode?: JSDocParsingMode;
jsDocParsingMode?: JSDocParsingMode | undefined;
}
type WithMetadata<T> = T & {
metadata?: unknown;
Expand Down
1 change: 1 addition & 0 deletions tests/cases/compiler/APILibCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// @noImplicitAny: true
// @strictNullChecks: true
// @lib: es2018
// @exactOptionalPropertyTypes: true

// @filename: node_modules/typescript/package.json
{
Expand Down