Quoted my own comment from:
https://www.drupal.org/node/2501679#comment-10568980

Boolean in Javascript should be `Boolean` (or case-insensitive `boolean` in JSDoc is also acceptable).

It's different than PHP. PHP accepts both `bool` or `boolean`. e.g.:

var_dump((boolean) 1);
var_dump((bool) 1);

But only `Boolean` in JS

Boolean(1);
new Boolean;

To match PHP Doc better, we should use small caps `boolean` to suppress 3rd parties validation warnings.

Comments

droplet created an issue. See original summary.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

droplet’s picture

Issue tags: +js-novice, +Quick fix
dylf’s picture

Status: Needs review » Reviewed & tested by the community

+1

star-szr’s picture

Status: Reviewed & tested by the community » Needs work

A couple points:

  1. This seems to be incomplete (only handles @return?), and there are plenty of uses in @param, @prop, etc.:
    • core/misc/ajax.es6.js:
         * @prop {bool} [keypress=true]
         *   Triggers a request on keypress events.
    • core/misc/debounce.es6.js:
       * @param {bool} immediate
       *   Whether we wait at the beginning or end to execute the function.
    • …many more, not going to list them all out here.
  2. Can this standard be included in our eslint config if it isn't already?
droplet’s picture

Status: Needs work » Needs review
StatusFileSize
new38.17 KB

Can this standard be included in our eslint config if it isn't already?

should be a follow-up. We need to decide what to do and pick a package. (there's no official rule for type checking)

mahalingam_cs’s picture

Verified patch fromo #6 and it looks good.

mahalingam_cs’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 6: 2894269-6.patch, failed testing. View results

dylf’s picture

Status: Needs work » Needs review
StatusFileSize
new38.46 KB

Rerolled

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
_pratik_’s picture

Assigned: Unassigned » _pratik_
_pratik_’s picture

Status: Needs work » Needs review
StatusFileSize
new25.07 KB

Here is a rerolled patch for 10.1.x

_pratik_’s picture

Assigned: _pratik_ » Unassigned
nod_’s picture

Status: Needs review » Needs work

Thanks! there are only a few missing:

core/misc/tabledrag.js line 180 and 372
core/misc/tableheader line 41
core/modules/editor/js/editor.admin.js line 214

akram khan’s picture

StatusFileSize
new25.91 KB
new12.72 KB

Updated patch and address #25

nod_’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll

Perfect, thank you!

catch’s picture

Is this something we can add linting for?

nod_’s picture

It's possible through the eslint-plugin-jsdoc package.

I'm not sure it's a good idea to add that here, our jsdoc linting hasn't been working for a while so there'll be lots to fix. I'll open a follow up

nod_’s picture

catch’s picture

Version: 10.1.x-dev » 10.0.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!

  • catch committed 49d68ce on 10.0.x
    Issue #2894269 by droplet, Akram Khan, _pratik_, dylf, nod_, Cottser: `...
  • catch committed 8c2256b on 10.1.x
    Issue #2894269 by droplet, Akram Khan, _pratik_, dylf, nod_, Cottser: `...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.