function formatBadTagErrorMessage()

in jsdoc/processors/extract-tags.js [183:208]


  function formatBadTagErrorMessage(doc) {
    let id = (doc.id || doc.name);
    id = id ? '"' + id + '" ' : '';
    let message = createDocMessage('Invalid tags found', doc) + '\n';

    doc.tags.badTags.forEach(badTag => {
      let description = typeof badTag.description === 'string' ? badTag.description.substr(0, 20) + '...' : '';
      if ( badTag.name ) {
        description = badTag.name + ' ' + description;
      }
      if ( badTag.typeExpression ) {
        description = '{' + badTag.typeExpression + '} ' + description;
      }

      message += 'Line: ' + badTag.startingLine + ': @' + badTag.tagName + ' ' + description + '\n';

      // An object of type `Tag` in the `badTags` list does not necessarily have an `errors`
      // field attached. This can happen when the tag does not have a tag definition at all.
      // We only append more specific error messages if such concrete errors are available.
      if (badTag.errors !== undefined) {
        badTag.errors.forEach(error => message += '    * ' + error + '\n');
      }
    });

    return message + '\n';
  }