Skip to content

Commit 4f71560

Browse files
committed
Fix reported line numbers
1 parent f5c485d commit 4f71560

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/rules/validTypes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,21 @@ export default iterateJsdoc(({
7777
}
7878
} else {
7979
if (mustHaveEither && !hasEither) {
80-
report(`Tag @${tag.tag} must have either a type or namepath`);
80+
report(`Tag @${tag.tag} must have either a type or namepath`, null, tag);
8181

8282
return;
8383
}
8484

8585
if (hasType) {
8686
validTypeParsing(tag.type);
8787
} else if (mustHaveType) {
88-
report(`Tag @${tag.tag} must have a type`);
88+
report(`Tag @${tag.tag} must have a type`, null, tag);
8989
}
9090

9191
if (hasNamePath) {
9292
validTypeParsing(tag.name, tag.tag);
9393
} else if (mustHaveNamepath) {
94-
report(`Tag @${tag.tag} must have a namepath`);
94+
report(`Tag @${tag.tag} must have a namepath`, null, tag);
9595
}
9696
}
9797
});

test/rules/assertions/validTypes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export default {
161161
}
162162
`,
163163
errors: [{
164-
line: 2,
164+
line: 3,
165165
message: 'Tag @callback must have a namepath'
166166
}],
167167
settings: {
@@ -219,7 +219,7 @@ export default {
219219
`,
220220
errors: [
221221
{
222-
line: 2,
222+
line: 3,
223223
message: 'Tag @extends must have either a type or namepath'
224224
}
225225
]
@@ -233,7 +233,7 @@ export default {
233233
`,
234234
errors: [
235235
{
236-
line: 2,
236+
line: 3,
237237
message: 'Tag @type must have a type'
238238
}
239239
]

0 commit comments

Comments
 (0)