Skip to content

Commit 44331b9

Browse files
authored
Fix grammar issue in TS9025 diagnostic message (#60136)
1 parent b845fd2 commit 44331b9

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

src/compiler/diagnosticMessages.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7058,7 +7058,7 @@
70587058
"category": "Error",
70597059
"code": 9023
70607060
},
7061-
"Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.": {
7061+
"Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.": {
70627062
"category": "Error",
70637063
"code": 9025
70647064
},

src/compiler/transformers/declarations/diagnostics.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export function createGetIsolatedDeclarationErrors(resolver: EmitResolver): (nod
772772
return createExpressionError(node.initializer);
773773
}
774774
const message = addUndefined ?
775-
Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations :
775+
Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations :
776776
errorByDeclarationKind[node.kind];
777777
const diag = createDiagnosticForNode(node, message);
778778
const targetStr = getTextOfNode(node.name, /*includeTrivia*/ false);

src/services/codefixes/fixMissingTypeAnnotationOnExports.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const errorCodes = [
135135
Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code,
136136
Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code,
137137
Diagnostics.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code,
138-
Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations.code,
138+
Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations.code,
139139
Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code,
140140
Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code,
141141
];

tests/baselines/reference/transpile/declarationFunctionDeclarations.d.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ export {};
125125

126126

127127
//// [Diagnostics reported]
128-
fnDecl.ts(12,27): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
129-
fnDecl.ts(16,36): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
130-
fnDecl.ts(20,26): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
131-
fnDecl.ts(24,56): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
132-
fnDecl.ts(28,46): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
133-
fnDecl.ts(32,45): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
134-
fnDecl.ts(37,47): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
135-
fnDecl.ts(41,37): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
136-
fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
128+
fnDecl.ts(12,27): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
129+
fnDecl.ts(16,36): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
130+
fnDecl.ts(20,26): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
131+
fnDecl.ts(24,56): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
132+
fnDecl.ts(28,46): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
133+
fnDecl.ts(32,45): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
134+
fnDecl.ts(37,47): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
135+
fnDecl.ts(41,37): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
136+
fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
137137

138138

139139
==== fnDecl.ts (9 errors) ====
@@ -150,64 +150,64 @@ fnDecl.ts(45,35): error TS9025: Declaration emit for this parameter requires imp
150150
export function fnDeclHasUndefined(p: T | undefined = [], rParam: string): void { };
151151
export function fnDeclBad(p: T = [], rParam: string): void { };
152152
~~~~~~~~~
153-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
153+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
154154
!!! related TS9028 fnDecl.ts:12:27: Add a type annotation to the parameter p.
155155

156156
export const fnExprOk1 = function (array: number[] = [], rParam: string): void { };
157157
export const fnExprOk2 = function (array: T | undefined = [], rParam: string): void { };
158158
export const fnExprBad = function (array: T = [], rParam: string): void { };
159159
~~~~~~~~~~~~~
160-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
160+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
161161
!!! related TS9028 fnDecl.ts:16:36: Add a type annotation to the parameter array.
162162

163163
export const arrowOk1 = (array: number[] = [], rParam: string): void => { };
164164
export const arrowOk2 = (array: T | undefined = [], rParam: string): void => { };
165165
export const arrowBad = (array: T = [], rParam: string): void => { };
166166
~~~~~~~~~~~~~
167-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
167+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
168168
!!! related TS9028 fnDecl.ts:20:26: Add a type annotation to the parameter array.
169169

170170
export const inObjectLiteralFnExprOk1 = { o: function (array: number[] = [], rParam: string): void { } };
171171
export const inObjectLiteralFnExprOk2 = { o: function (array: T | undefined = [], rParam: string): void { } };
172172
export const inObjectLiteralFnExprBad = { o: function (array: T = [], rParam: string): void { } };
173173
~~~~~~~~~~~~~
174-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
174+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
175175
!!! related TS9028 fnDecl.ts:24:56: Add a type annotation to the parameter array.
176176

177177
export const inObjectLiteralArrowOk1 = { o: (array: number[] = [], rParam: string): void => { } };
178178
export const inObjectLiteralArrowOk2 = { o: (array: T | undefined = [], rParam: string): void => { } };
179179
export const inObjectLiteralArrowBad = { o: (array: T = [], rParam: string): void => { } };
180180
~~~~~~~~~~~~~
181-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
181+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
182182
!!! related TS9028 fnDecl.ts:28:46: Add a type annotation to the parameter array.
183183

184184
export const inObjectLiteralMethodOk1 = { o(array: number[] = [], rParam: string): void { } };
185185
export const inObjectLiteralMethodOk2 = { o(array: T | undefined = [], rParam: string): void { } };
186186
export const inObjectLiteralMethodBad = { o(array: T = [], rParam: string): void { } };
187187
~~~~~~~~~~~~~
188-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
188+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
189189
!!! related TS9028 fnDecl.ts:32:45: Add a type annotation to the parameter array.
190190

191191

192192
export class InClassFnExprOk1 { o = function (array: number[] = [], rParam: string): void { } };
193193
export class InClassFnExprOk2 { o = function (array: T | undefined = [], rParam: string): void { } };
194194
export class InClassFnExprBad { o = function (array: T = [], rParam: string): void { } };
195195
~~~~~~~~~~~~~
196-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
196+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
197197
!!! related TS9028 fnDecl.ts:37:47: Add a type annotation to the parameter array.
198198

199199
export class InClassArrowOk1 { o = (array: number[] = [], rParam: string): void => { } };
200200
export class InClassArrowOk2 { o = (array: T | undefined = [], rParam: string): void => { } };
201201
export class InClassArrowBad { o = (array: T = [], rParam: string): void => { } };
202202
~~~~~~~~~~~~~
203-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
203+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
204204
!!! related TS9028 fnDecl.ts:41:37: Add a type annotation to the parameter array.
205205

206206
export class InClassMethodOk1 { o(array: number[] = [], rParam: string): void { } };
207207
export class InClassMethodOk2 { o(array: T | undefined = [], rParam: string): void { } };
208208
export class InClassMethodBad { o(array: T = [], rParam: string): void { } };
209209
~~~~~~~~~~~~~
210-
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.
210+
!!! error TS9025: Declaration emit for this parameter requires implicitly adding undefined to its type. This is not supported with --isolatedDeclarations.
211211
!!! related TS9028 fnDecl.ts:45:35: Add a type annotation to the parameter array.
212212

213213

0 commit comments

Comments
 (0)