Skip to content

Commit 2f104f8

Browse files
chearonbrettz9
andauthored
fix(require-param-type): report column=1 (#875)
* fix(`require-param-type`): report column=1 Source ```js /** * @param {a xxx * @param {bc */ ``` Before ``` 2:0 error Missing JSDoc @param "" type jsdoc/require-param-type 3:0 error Missing JSDoc @param "" type jsdoc/require-param-type ``` After ``` 2:1 error Missing JSDoc @param "" type jsdoc/require-param-type 3:1 error Missing JSDoc @param "" type jsdoc/require-param-type ``` Co-authored-by: Brett Zamir <brettz9@yahoo.com>
1 parent bd11409 commit 2f104f8

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14867,6 +14867,13 @@ function quux (foo) {
1486714867
}
1486814868
// Message: Missing JSDoc @param "foo" type.
1486914869

14870+
/**
14871+
* @param {a xxx
14872+
*/
14873+
function quux () {
14874+
}
14875+
// Message: Missing JSDoc @param "" type.
14876+
1487014877
/**
1487114878
* @param foo
1487214879
*/

src/iterateJsdoc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,9 +844,11 @@ const makeReport = (context, commentNode) => {
844844

845845
loc = {
846846
end: {
847+
column: 0,
847848
line: lineNumber,
848849
},
849850
start: {
851+
column: 0,
850852
line: lineNumber,
851853
},
852854
};

test/rules/assertions/requireParamType.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,28 @@ export default {
1111
`,
1212
errors: [
1313
{
14+
column: 1,
1415
line: 3,
1516
message: 'Missing JSDoc @param "foo" type.',
1617
},
1718
],
1819
},
20+
{
21+
code: `
22+
/**
23+
* @param {a xxx
24+
*/
25+
function quux () {
26+
}
27+
`,
28+
errors: [
29+
{
30+
column: 1,
31+
line: 3,
32+
message: 'Missing JSDoc @param "" type.',
33+
},
34+
],
35+
},
1936
{
2037
code: `
2138
/**
@@ -27,6 +44,7 @@ export default {
2744
`,
2845
errors: [
2946
{
47+
column: 1,
3048
line: 3,
3149
message: 'Missing JSDoc @param "foo" type.',
3250
},
@@ -48,6 +66,7 @@ export default {
4866
`,
4967
errors: [
5068
{
69+
column: 1,
5170
line: 4,
5271
message: 'Missing JSDoc @param "foo" type.',
5372
},
@@ -69,6 +88,7 @@ export default {
6988
`,
7089
errors: [
7190
{
91+
column: 1,
7292
line: 4,
7393
message: 'Missing JSDoc @param "foo" type.',
7494
},
@@ -92,6 +112,7 @@ export default {
92112
`,
93113
errors: [
94114
{
115+
column: 1,
95116
line: 3,
96117
message: 'Missing JSDoc @arg "foo" type.',
97118
},
@@ -115,6 +136,7 @@ export default {
115136
`,
116137
errors: [
117138
{
139+
column: 1,
118140
line: 3,
119141
message: 'Unexpected tag `@param`',
120142
},

0 commit comments

Comments
 (0)