Skip to content

Commit 86a1bb6

Browse files
committed
Switched to tagMightHaveEitherTypeOrNamePosition
1 parent 84168fe commit 86a1bb6

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

src/getDefaultTagStructureForMode.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,6 @@ const getDefaultTagStructureForMode = (mode) => {
470470
[
471471
'typeOrNameRequired', true,
472472
],
473-
474-
// "type"
475-
[
476-
'typeAllowed', true,
477-
],
478473
]),
479474
],
480475

@@ -490,11 +485,6 @@ const getDefaultTagStructureForMode = (mode) => {
490485
[
491486
'typeOrNameRequired', true,
492487
],
493-
494-
// "type"
495-
[
496-
'typeAllowed', true,
497-
],
498488
]),
499489
],
500490

@@ -510,11 +500,6 @@ const getDefaultTagStructureForMode = (mode) => {
510500
[
511501
'typeOrNameRequired', true,
512502
],
513-
514-
// "type"
515-
[
516-
'typeAllowed', true,
517-
],
518503
]),
519504
],
520505

src/iterateJsdoc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ const getUtils = (
769769
for (const method of [
770770
'tagMightHaveNamePosition',
771771
'tagMightHaveTypePosition',
772+
'tagMightHaveEitherTypeOrNamePosition',
772773
]) {
773774
utils[method] = (tagName, otherModeMaps) => {
774775
const result = jsdocUtils[method](tagName);

src/jsdocUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ export default {
12741274
parseClosureTemplateTag,
12751275
pathDoesNotBeginWith,
12761276
setTagStructure,
1277+
tagMightHaveEitherTypeOrNamePosition,
12771278
tagMightHaveNamepath,
12781279
tagMightHaveNamePosition,
12791280
tagMightHaveTypePosition,

src/rules/noUndefinedTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ export default iterateJsdoc(({
189189
const jsdocTagsWithPossibleType = utils.filterTags(({
190190
tag,
191191
}) => {
192-
return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
192+
return utils.tagMightHaveEitherTypeOrNamePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
193193
});
194194

195195
for (const tag of jsdocTagsWithPossibleType) {
196-
const possibleType = tag.type || tag.namepathOrURL;
196+
const possibleType = tag.type || tag.name || tag.namepathOrURL;
197197

198198
let parsedType;
199199

test/rules/assertions/noUndefinedTypes.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ export default {
387387
*/
388388
`,
389389
errors: [
390+
{
391+
line: 3,
392+
message: 'The type \'SomeType\' is undefined.',
393+
},
390394
{
391395
line: 6,
392396
message: 'The type \'SomeType\' is undefined.',
@@ -412,6 +416,10 @@ export default {
412416
*/
413417
`,
414418
errors: [
419+
{
420+
line: 3,
421+
message: 'The type \'SomeType\' is undefined.',
422+
},
415423
{
416424
line: 6,
417425
message: 'The type \'SomeType\' is undefined.',

0 commit comments

Comments
 (0)