Make WordPress Core


Ignore:
Timestamp:
12/15/2017 01:41:56 PM (8 years ago)
Author:
atimmer
Message:

Docs: Improve wp-admin JSDoc structural data globally.

JSDoc takes it structural data from @namespace, @lends and @memberOf. This change fixes these tags for all JavaScript files in the wp-admin folder.

  • Add jsdoc configuration to parse wp-admin/js files. Use jsdoc -c jsdoc.conf.json to generate JSDoc.
  • Define all used namespaces using @namespace.
  • Define each usage of the extend function as a prototype assignment using @lends.
  • Add @alias if JSDoc cannot detect the correct name automatically.

This has previously been corrected for all wp-includes JavaScript files: [41351].

Props herregroen.
Fixes #42485.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/code-editor.js

    r41992 r42403  
    11if ( 'undefined' === typeof window.wp ) {
     2    /**
     3     * @namespace wp
     4     */
    25    window.wp = {};
    36}
    47if ( 'undefined' === typeof window.wp.codeEditor ) {
     8    /**
     9     * @namespace wp.codeEditor
     10     */
    511    window.wp.codeEditor = {};
    612}
     
    3440     * @param {Function}   settings.onChangeLintingErrors - Callback for when there are changes to linting errors.
    3541     * @param {Function}   settings.onUpdateErrorNotice - Callback to update error notice.
     42     *
    3643     * @returns {void}
    3744     */
     
    203210     * @param {Function}   settings.onTabNext - Callback to handle tabbing to the next tabbable element.
    204211     * @param {Function}   settings.onTabPrevious - Callback to handle tabbing to the previous tabbable element.
     212     *
    205213     * @returns {void}
    206214     */
     
    241249
    242250    /**
    243      * @typedef {object} CodeEditorInstance
     251     * @typedef {object} wp.codeEditor~CodeEditorInstance
    244252     * @property {object} settings - The code editor settings.
    245253     * @property {CodeMirror} codemirror - The CodeMirror instance.
     
    261269     * @param {object}                [settings.htmlhint] - Rules for HTMLHint.
    262270     * @param {object}                [settings.jshint] - Rules for JSHint.
     271     *
    263272     * @returns {CodeEditorInstance} Instance.
    264273     */
Note: See TracChangeset for help on using the changeset viewer.