diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4b2460e2630..1850501e546 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1708,7 +1708,7 @@ export interface AutoGenerateInfo { /** @internal */ export interface GeneratedIdentifier extends Identifier { - readonly emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; }; + emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; }; } export interface QualifiedName extends Node, FlowContainer { @@ -1787,7 +1787,7 @@ export interface PrivateIdentifier extends PrimaryExpression { /** @internal */ export interface GeneratedPrivateIdentifier extends PrivateIdentifier { - readonly emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; }; + emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; }; } /** @internal */ diff --git a/src/server/project.ts b/src/server/project.ts index db1e5307f74..aa3d64e14e9 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -346,8 +346,8 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo public languageServiceEnabled: boolean; - readonly trace?: (s: string) => void; - readonly realpath?: (path: string) => string; + trace?(s: string): void; + realpath?(path: string): string; /** @internal */ hasInvalidatedResolutions?: HasInvalidatedResolutions | undefined; @@ -513,7 +513,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo /** @internal */ createHash = maybeBind(this.projectService.host, this.projectService.host.createHash); - readonly jsDocParsingMode: JSDocParsingMode | undefined; + jsDocParsingMode: JSDocParsingMode | undefined; /** @internal */ constructor( diff --git a/src/server/protocol.ts b/src/server/protocol.ts index b27fb4d5c3d..46f52d532c4 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -900,15 +900,15 @@ export interface DefinitionRequest extends FileLocationRequest { } export interface DefinitionAndBoundSpanRequest extends FileLocationRequest { - readonly command: CommandTypes.DefinitionAndBoundSpan; + command: CommandTypes.DefinitionAndBoundSpan; } export interface FindSourceDefinitionRequest extends FileLocationRequest { - readonly command: CommandTypes.FindSourceDefinition; + command: CommandTypes.FindSourceDefinition; } export interface DefinitionAndBoundSpanResponse extends Response { - readonly body: DefinitionInfoAndBoundSpan; + body: DefinitionInfoAndBoundSpan; } /** @internal */ @@ -924,7 +924,7 @@ export interface EmitOutputRequestArgs extends FileRequestArgs { } /** @internal */ export interface EmitOutputResponse extends Response { - readonly body: EmitOutput | ts.EmitOutput; + body: EmitOutput | ts.EmitOutput; } /** @internal */ export interface EmitOutput { @@ -1061,18 +1061,18 @@ export interface BraceCompletionRequestArgs extends FileLocationRequestArgs { } export interface JsxClosingTagRequest extends FileLocationRequest { - readonly command: CommandTypes.JsxClosingTag; - readonly arguments: JsxClosingTagRequestArgs; + command: CommandTypes.JsxClosingTag; + arguments: JsxClosingTagRequestArgs; } export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {} export interface JsxClosingTagResponse extends Response { - readonly body: TextInsertion; + body: TextInsertion; } export interface LinkedEditingRangeRequest extends FileLocationRequest { - readonly command: CommandTypes.LinkedEditingRange; + command: CommandTypes.LinkedEditingRange; } export interface LinkedEditingRangesBody { @@ -1081,7 +1081,7 @@ export interface LinkedEditingRangesBody { } export interface LinkedEditingRangeResponse extends Response { - readonly body: LinkedEditingRangesBody; + body: LinkedEditingRangesBody; } /** @@ -1234,13 +1234,13 @@ export interface RenameRequest extends FileLocationRequest { /** @internal */ export interface RenameFullRequest extends FileLocationRequest { - readonly command: CommandTypes.RenameLocationsFull; - readonly arguments: RenameRequestArgs; + command: CommandTypes.RenameLocationsFull; + arguments: RenameRequestArgs; } /** @internal */ export interface RenameFullResponse extends Response { - readonly body: readonly RenameLocation[]; + body: readonly RenameLocation[]; } /** @@ -2637,8 +2637,8 @@ export interface LargeFileReferencedEventBody { export type CreateFileWatcherEventName = "createFileWatcher"; export interface CreateFileWatcherEvent extends Event { - readonly event: CreateFileWatcherEventName; - readonly body: CreateFileWatcherEventBody; + event: CreateFileWatcherEventName; + body: CreateFileWatcherEventBody; } export interface CreateFileWatcherEventBody { @@ -2648,8 +2648,8 @@ export interface CreateFileWatcherEventBody { export type CreateDirectoryWatcherEventName = "createDirectoryWatcher"; export interface CreateDirectoryWatcherEvent extends Event { - readonly event: CreateDirectoryWatcherEventName; - readonly body: CreateDirectoryWatcherEventBody; + event: CreateDirectoryWatcherEventName; + body: CreateDirectoryWatcherEventBody; } export interface CreateDirectoryWatcherEventBody { @@ -2661,8 +2661,8 @@ export interface CreateDirectoryWatcherEventBody { export type CloseFileWatcherEventName = "closeFileWatcher"; export interface CloseFileWatcherEvent extends Event { - readonly event: CloseFileWatcherEventName; - readonly body: CloseFileWatcherEventBody; + event: CloseFileWatcherEventName; + body: CloseFileWatcherEventBody; } export interface CloseFileWatcherEventBody { @@ -3050,7 +3050,7 @@ export interface PrepareCallHierarchyRequest extends FileLocationRequest { } export interface PrepareCallHierarchyResponse extends Response { - readonly body: CallHierarchyItem | CallHierarchyItem[]; + body: CallHierarchyItem | CallHierarchyItem[]; } export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest { @@ -3058,7 +3058,7 @@ export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRe } export interface ProvideCallHierarchyIncomingCallsResponse extends Response { - readonly body: CallHierarchyIncomingCall[]; + body: CallHierarchyIncomingCall[]; } export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest { @@ -3066,7 +3066,7 @@ export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRe } export interface ProvideCallHierarchyOutgoingCallsResponse extends Response { - readonly body: CallHierarchyOutgoingCall[]; + body: CallHierarchyOutgoingCall[]; } export const enum IndentStyle { diff --git a/tests/cases/compiler/APILibCheck.ts b/tests/cases/compiler/APILibCheck.ts index 7abf10e9821..d60fba58fa6 100644 --- a/tests/cases/compiler/APILibCheck.ts +++ b/tests/cases/compiler/APILibCheck.ts @@ -3,6 +3,7 @@ // @strictNullChecks: true // @lib: es2018 // @exactOptionalPropertyTypes: true +// @enforceReadonly: true // @noTypesAndSymbols: true // @filename: node_modules/typescript/package.json