diff --git a/README.md b/README.md index f5974abbc..dd1daa485 100644 --- a/README.md +++ b/README.md @@ -14867,6 +14867,13 @@ function quux (foo) { } // Message: Missing JSDoc @param "foo" type. +/** + * @param {a xxx + */ +function quux () { +} +// Message: Missing JSDoc @param "" type. + /** * @param foo */ diff --git a/src/iterateJsdoc.js b/src/iterateJsdoc.js index 819a83498..0a6e848c7 100644 --- a/src/iterateJsdoc.js +++ b/src/iterateJsdoc.js @@ -844,9 +844,11 @@ const makeReport = (context, commentNode) => { loc = { end: { + column: 0, line: lineNumber, }, start: { + column: 0, line: lineNumber, }, }; diff --git a/test/rules/assertions/requireParamType.js b/test/rules/assertions/requireParamType.js index c6f4afbf9..b63012e73 100644 --- a/test/rules/assertions/requireParamType.js +++ b/test/rules/assertions/requireParamType.js @@ -11,11 +11,28 @@ export default { `, errors: [ { + column: 1, line: 3, message: 'Missing JSDoc @param "foo" type.', }, ], }, + { + code: ` + /** + * @param {a xxx + */ + function quux () { + } + `, + errors: [ + { + column: 1, + line: 3, + message: 'Missing JSDoc @param "" type.', + }, + ], + }, { code: ` /** @@ -27,6 +44,7 @@ export default { `, errors: [ { + column: 1, line: 3, message: 'Missing JSDoc @param "foo" type.', }, @@ -48,6 +66,7 @@ export default { `, errors: [ { + column: 1, line: 4, message: 'Missing JSDoc @param "foo" type.', }, @@ -69,6 +88,7 @@ export default { `, errors: [ { + column: 1, line: 4, message: 'Missing JSDoc @param "foo" type.', }, @@ -92,6 +112,7 @@ export default { `, errors: [ { + column: 1, line: 3, message: 'Missing JSDoc @arg "foo" type.', }, @@ -115,6 +136,7 @@ export default { `, errors: [ { + column: 1, line: 3, message: 'Unexpected tag `@param`', },