Skip to content

Commit 6fafe58

Browse files
committed
Compile APILibCheck.ts with --enforceReadonly
1 parent 638e55c commit 6fafe58

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

src/compiler/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ export interface AutoGenerateInfo {
17081708

17091709
/** @internal */
17101710
export interface GeneratedIdentifier extends Identifier {
1711-
readonly emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; };
1711+
emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; };
17121712
}
17131713

17141714
export interface QualifiedName extends Node, FlowContainer {
@@ -1787,7 +1787,7 @@ export interface PrivateIdentifier extends PrimaryExpression {
17871787

17881788
/** @internal */
17891789
export interface GeneratedPrivateIdentifier extends PrivateIdentifier {
1790-
readonly emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; };
1790+
emitNode: EmitNode & { autoGenerate: AutoGenerateInfo; };
17911791
}
17921792

17931793
/** @internal */

src/server/project.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
346346

347347
public languageServiceEnabled: boolean;
348348

349-
readonly trace?: (s: string) => void;
350-
readonly realpath?: (path: string) => string;
349+
trace?(s: string): void;
350+
realpath?(path: string): string;
351351

352352
/** @internal */
353353
hasInvalidatedResolutions?: HasInvalidatedResolutions | undefined;
@@ -513,7 +513,7 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
513513
/** @internal */
514514
createHash = maybeBind(this.projectService.host, this.projectService.host.createHash);
515515

516-
readonly jsDocParsingMode: JSDocParsingMode | undefined;
516+
jsDocParsingMode: JSDocParsingMode | undefined;
517517

518518
/** @internal */
519519
constructor(

src/server/protocol.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -900,15 +900,15 @@ export interface DefinitionRequest extends FileLocationRequest {
900900
}
901901

902902
export interface DefinitionAndBoundSpanRequest extends FileLocationRequest {
903-
readonly command: CommandTypes.DefinitionAndBoundSpan;
903+
command: CommandTypes.DefinitionAndBoundSpan;
904904
}
905905

906906
export interface FindSourceDefinitionRequest extends FileLocationRequest {
907-
readonly command: CommandTypes.FindSourceDefinition;
907+
command: CommandTypes.FindSourceDefinition;
908908
}
909909

910910
export interface DefinitionAndBoundSpanResponse extends Response {
911-
readonly body: DefinitionInfoAndBoundSpan;
911+
body: DefinitionInfoAndBoundSpan;
912912
}
913913

914914
/** @internal */
@@ -924,7 +924,7 @@ export interface EmitOutputRequestArgs extends FileRequestArgs {
924924
}
925925
/** @internal */
926926
export interface EmitOutputResponse extends Response {
927-
readonly body: EmitOutput | ts.EmitOutput;
927+
body: EmitOutput | ts.EmitOutput;
928928
}
929929
/** @internal */
930930
export interface EmitOutput {
@@ -1061,18 +1061,18 @@ export interface BraceCompletionRequestArgs extends FileLocationRequestArgs {
10611061
}
10621062

10631063
export interface JsxClosingTagRequest extends FileLocationRequest {
1064-
readonly command: CommandTypes.JsxClosingTag;
1065-
readonly arguments: JsxClosingTagRequestArgs;
1064+
command: CommandTypes.JsxClosingTag;
1065+
arguments: JsxClosingTagRequestArgs;
10661066
}
10671067

10681068
export interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {}
10691069

10701070
export interface JsxClosingTagResponse extends Response {
1071-
readonly body: TextInsertion;
1071+
body: TextInsertion;
10721072
}
10731073

10741074
export interface LinkedEditingRangeRequest extends FileLocationRequest {
1075-
readonly command: CommandTypes.LinkedEditingRange;
1075+
command: CommandTypes.LinkedEditingRange;
10761076
}
10771077

10781078
export interface LinkedEditingRangesBody {
@@ -1081,7 +1081,7 @@ export interface LinkedEditingRangesBody {
10811081
}
10821082

10831083
export interface LinkedEditingRangeResponse extends Response {
1084-
readonly body: LinkedEditingRangesBody;
1084+
body: LinkedEditingRangesBody;
10851085
}
10861086

10871087
/**
@@ -1234,13 +1234,13 @@ export interface RenameRequest extends FileLocationRequest {
12341234

12351235
/** @internal */
12361236
export interface RenameFullRequest extends FileLocationRequest {
1237-
readonly command: CommandTypes.RenameLocationsFull;
1238-
readonly arguments: RenameRequestArgs;
1237+
command: CommandTypes.RenameLocationsFull;
1238+
arguments: RenameRequestArgs;
12391239
}
12401240

12411241
/** @internal */
12421242
export interface RenameFullResponse extends Response {
1243-
readonly body: readonly RenameLocation[];
1243+
body: readonly RenameLocation[];
12441244
}
12451245

12461246
/**
@@ -2637,8 +2637,8 @@ export interface LargeFileReferencedEventBody {
26372637

26382638
export type CreateFileWatcherEventName = "createFileWatcher";
26392639
export interface CreateFileWatcherEvent extends Event {
2640-
readonly event: CreateFileWatcherEventName;
2641-
readonly body: CreateFileWatcherEventBody;
2640+
event: CreateFileWatcherEventName;
2641+
body: CreateFileWatcherEventBody;
26422642
}
26432643

26442644
export interface CreateFileWatcherEventBody {
@@ -2648,8 +2648,8 @@ export interface CreateFileWatcherEventBody {
26482648

26492649
export type CreateDirectoryWatcherEventName = "createDirectoryWatcher";
26502650
export interface CreateDirectoryWatcherEvent extends Event {
2651-
readonly event: CreateDirectoryWatcherEventName;
2652-
readonly body: CreateDirectoryWatcherEventBody;
2651+
event: CreateDirectoryWatcherEventName;
2652+
body: CreateDirectoryWatcherEventBody;
26532653
}
26542654

26552655
export interface CreateDirectoryWatcherEventBody {
@@ -2661,8 +2661,8 @@ export interface CreateDirectoryWatcherEventBody {
26612661

26622662
export type CloseFileWatcherEventName = "closeFileWatcher";
26632663
export interface CloseFileWatcherEvent extends Event {
2664-
readonly event: CloseFileWatcherEventName;
2665-
readonly body: CloseFileWatcherEventBody;
2664+
event: CloseFileWatcherEventName;
2665+
body: CloseFileWatcherEventBody;
26662666
}
26672667

26682668
export interface CloseFileWatcherEventBody {
@@ -3050,23 +3050,23 @@ export interface PrepareCallHierarchyRequest extends FileLocationRequest {
30503050
}
30513051

30523052
export interface PrepareCallHierarchyResponse extends Response {
3053-
readonly body: CallHierarchyItem | CallHierarchyItem[];
3053+
body: CallHierarchyItem | CallHierarchyItem[];
30543054
}
30553055

30563056
export interface ProvideCallHierarchyIncomingCallsRequest extends FileLocationRequest {
30573057
command: CommandTypes.ProvideCallHierarchyIncomingCalls;
30583058
}
30593059

30603060
export interface ProvideCallHierarchyIncomingCallsResponse extends Response {
3061-
readonly body: CallHierarchyIncomingCall[];
3061+
body: CallHierarchyIncomingCall[];
30623062
}
30633063

30643064
export interface ProvideCallHierarchyOutgoingCallsRequest extends FileLocationRequest {
30653065
command: CommandTypes.ProvideCallHierarchyOutgoingCalls;
30663066
}
30673067

30683068
export interface ProvideCallHierarchyOutgoingCallsResponse extends Response {
3069-
readonly body: CallHierarchyOutgoingCall[];
3069+
body: CallHierarchyOutgoingCall[];
30703070
}
30713071

30723072
export const enum IndentStyle {

tests/cases/compiler/APILibCheck.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// @strictNullChecks: true
44
// @lib: es2018
55
// @exactOptionalPropertyTypes: true
6+
// @enforceReadonly: true
67
// @noTypesAndSymbols: true
78

89
// @filename: node_modules/typescript/package.json

0 commit comments

Comments
 (0)