Make WordPress Core


Ignore:
Timestamp:
09/11/2026 10:50:50 AM (13 hours ago)
Author:
afercia
Message:

General: Fix indentation and alignments in JavaScript inline documentation blocks.

Enables the following JSDoc rules:

  • jsdoc/check-alignment
  • jsdoc/check-indentation
  • jsdoc/check-line-alignment
  • jsdoc/require-hyphen-before-param-description -> never

Fixes all the reported violations. Also removes hyphens before descriptions.

Part of the effort to improve JS inline documentation for 7.2.

Developed in https://github.com/WordPress/wordpress-develop/pull/13490

Props afercia, mukesh27.
See #66033.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/codemirror/javascript-lint.js

    r63407 r63600  
    1313 *
    1414 * @typedef {Object} CodeMirrorLintError
    15  * @property {string} message Error message.
    16  * @property {'error'} severity Severity.
    17  * @property {CodeMirror.Position} from From position.
    18  * @property {CodeMirror.Position} to To position.
     15 * @property {string}              message Error message.
     16 * @property {'error'}             severity Severity.
     17 * @property {CodeMirror.Position} from     From position.
     18 * @property {CodeMirror.Position} to       To position.
    1919 */
    2020
     
    2626 *
    2727 * @typedef {Object} SupportedJSHintOptions
    28  * @property {import('espree').Options['ecmaVersion']} [esversion] "This option is used to specify the ECMAScript version to which the code must adhere."
    29  * @property {boolean} [es5] "This option enables syntax first defined in the ECMAScript 5.1 specification. This includes allowing reserved keywords as object properties."
    30  * @property {boolean} [es3] "This option tells JSHint that your code needs to adhere to ECMAScript 3 specification. Use this option if you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9—and other legacy JavaScript environments."
    31  * @property {boolean} [module] "This option informs JSHint that the input code describes an ECMAScript 6 module. All module code is interpreted as strict mode code."
    32  * @property {'implied'} [strict] "This option requires the code to run in ECMAScript 5's strict mode."
    33  * @property {string} [espreeModuleUrl] The URL to the espree script module.
     28 * @property {import('espree').Options['ecmaVersion']} [esversion]       "This option is used to specify the ECMAScript version to which the code must adhere."
     29 * @property {boolean}                                 [es5]            "This option enables syntax first defined in the ECMAScript 5.1 specification. This includes allowing reserved keywords as object properties."
     30 * @property {boolean}                                 [es3]            "This option tells JSHint that your code needs to adhere to ECMAScript 3 specification. Use this option if you need your program to be executable in older browsers—such as Internet Explorer 6/7/8/9—and other legacy JavaScript environments."
     31 * @property {boolean}                                 [module]          "This option informs JSHint that the input code describes an ECMAScript 6 module. All module code is interpreted as strict mode code."
     32 * @property {'implied'}                               [strict]          "This option requires the code to run in ECMAScript 5's strict mode."
     33 * @property {string}                                  [espreeModuleUrl] The URL to the espree script module.
    3434 */
    3535
     
    3939 * @since 7.0.0
    4040 *
    41  * @param {string} text Source.
     41 * @param {string}                 text    Source.
    4242 * @param {SupportedJSHintOptions} options Linting options.
    4343 * @return {Promise<CodeMirrorLintError[]>} Linting errors.
Note: See TracChangeset for help on using the changeset viewer.