Skip to content

Commit

Permalink
Update jsdoc comments to better match WordPress coding standards (#38…
Browse files Browse the repository at this point in the history
…466)

More specifically, this enables a few linting rules from
`@wordpress/eslint-plugin` that had previously been disabled:

* For `jsdoc/check-tag-names`, prefer `@return` and `@yield` over
  `@returns` and `@yields`.
* Enable `jsdoc/check-line-alignment` for certain tags, most notably
  `@param.
* Update `jsdoc/check-indentation` rule config to not conflict with
  `jsdoc/check-line-alignment`.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10475642648

Upstream-Ref: Automattic/jetpack@199f506
  • Loading branch information
anomiex authored and matticbot committed Aug 20, 2024
1 parent f8dbd8b commit bcca1ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const warn = debug( '@automattic/eslint-config-target-es:warn' );
/**
* Get the list of supported browsers.
*
* @param {object} options - Options.
* @param {object} options - Options.
* @param {string} options.query - Browserslist query.
* @returns {object} Browsers mapped to arrays of versions.
* @return {object} Browsers mapped to arrays of versions.
*/
function getAllBrowsers( options = {} ) {
const browsers = {};
Expand Down Expand Up @@ -42,9 +42,9 @@ function getAllBrowsers( options = {} ) {
* Get the list of supported browsers.
*
* @deprecated since 2.1.0. Use getAllBrowsers instead.
* @param {object} options - Options.
* @param {object} options - Options.
* @param {string} options.query - Browserslist query.
* @returns {object} Browsers mapped to minimum versions.
* @return {object} Browsers mapped to minimum versions.
*/
function getBrowsers( options = {} ) {
warn( 'getBrowsers is deprecated. Use getAllBrowsers instead.' );
Expand All @@ -59,10 +59,10 @@ function getBrowsers( options = {} ) {
/**
* Get the es-x rule configurations.
*
* @param {object} options - Options.
* @param {object} options - Options.
* @param {boolean|null} options.builtins - If true, only rules with "javascript.builtins" paths are checked. If false, such rules are not checked. If null/undefined, all may be checked.
* @param {string} options.query - Browserslist query.
* @returns {object} Rules configuration.
* @param {string} options.query - Browserslist query.
* @return {object} Rules configuration.
*/
function getRules( options = {} ) {
const browsers = getAllBrowsers( options );
Expand Down
8 changes: 4 additions & 4 deletions src/needsCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const debuglog = debug( '@automattic/eslint-config-target-es:debug' );
/**
* Test if a rule needs to be checked.
*
* @param {string} rule - Rule.
* @param {object} browsers - Browsers targeted.
* @param {object} options - Options.
* @param {string} rule - Rule.
* @param {object} browsers - Browsers targeted.
* @param {object} options - Options.
* @param {boolean|null} options.builtins - If true, only rules with "javascript.builtins" paths are checked. If false, such rules are not checked. If null/undefined, all may be checked.
* @returns {boolean} Whether the rule needs to be checked.
* @return {boolean} Whether the rule needs to be checked.
*/
function needsCheck( rule, browsers, options = {} ) {
let paths = rulesMap[ rule ];
Expand Down

0 comments on commit bcca1ec

Please sign in to comment.