mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-16 15:51:35 -05:00
Improve unmatched jsdoc param error (#22577)
* Improve unmatched jsdoc parameter error message * Remove extraneous carriage return
This commit is contained in:
@@ -21476,7 +21476,7 @@ namespace ts {
|
||||
node.typeExpression && node.typeExpression.type &&
|
||||
!isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
|
||||
error(node.name,
|
||||
Diagnostics.The_last_param_tag_of_a_function_that_uses_arguments_must_have_an_array_type,
|
||||
Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,
|
||||
idText(node.name.kind === SyntaxKind.QualifiedName ? node.name.right : node.name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3720,7 +3720,7 @@
|
||||
"category": "Error",
|
||||
"code": 8028
|
||||
},
|
||||
"The last @param tag of a function that uses 'arguments' must have an array type.": {
|
||||
"JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type.": {
|
||||
"category": "Error",
|
||||
"code": 8029
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/jsdoc/a.js(2,20): error TS8029: The last @param tag of a function that uses 'arguments' must have an array type.
|
||||
tests/cases/conformance/jsdoc/a.js(2,20): error TS8029: JSDoc '@param' tag has name 'first', but there is no parameter with that name. It would match 'arguments' if it had an array type.
|
||||
tests/cases/conformance/jsdoc/a.js(19,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/jsdoc/a.js(19,9): error TS2345: Argument of type '1' is
|
||||
/**
|
||||
* @param {string} first
|
||||
~~~~~
|
||||
!!! error TS8029: The last @param tag of a function that uses 'arguments' must have an array type.
|
||||
!!! error TS8029: JSDoc '@param' tag has name 'first', but there is no parameter with that name. It would match 'arguments' if it had an array type.
|
||||
*/
|
||||
function concat(/* first, second, ... */) {
|
||||
var s = ''
|
||||
|
||||
Reference in New Issue
Block a user