Skip to content

Minor syntax issues with JSDoc #30445

@PoseidonEnergy

Description

@PoseidonEnergy

Description

I just want to highlight some minor things that are showing up as errors with my IDE (JetBrains Rider) with the new JSDoc annotations.

Primitive types shouldn't be capitalized:

  1. {String} should be {string}
  2. {Boolean} should be {boolean}
  3. {Number} should be {number}
  4. {Any} should be {any}

The question mark ? to denote a nullable type should come before the type, not after.

For example: {MyType?} should be {?MyType} (see https://jsdoc.app/tags-type)

Image

Example of invalid JSDoc syntax in src/nodes/core/Node.js:

/**
* The cache key of this node.
*
* @private
* @type {Number?}
* @default null
*/
this._cacheKey = null;

Screenshot of IDE error (JetBrains Rider):

Image

Version

173

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions