6

I'm wondering how to documenting jQuery plugin by using JSDoc? My code is:

   /**
     * The default configurations of comments
     * @typedef {Object} CommentConfig
     ...
     */

   /**
     * Show comments
     * @method comments
     * @version 1.0.1
     * @param {CommentConfig} options Configuration of comment
     */
    $.fn.comments = function (options) {
        // ..
    }

I want @method is $.fn.comments but it doesn't work.

Cœur
  • 37,241
  • 25
  • 195
  • 267
ducdhm
  • 1,954
  • 15
  • 26

1 Answers1

7

Acording to JSDoc3 docs you should use @external in your case:

/**
 * The jQuery plugin namespace.
 * @external "jQuery.fn"
 * @see {@link http://docs.jquery.com/Plugins/Authoring The jQuery Plugin Guide}
 */

/**
 * Show comments
 * @function external:"jQuery.fn".comments
 */
Lesha Ogonkov
  • 1,218
  • 8
  • 20