Skip to content

Add a common jsdoc typedefs file to project #29

@aljones15

Description

@aljones15

We have plenty of common types across projects such as

  1. integer
  2. RFC3349Date
  3. JSON-LD

etc.

This is a proposal to add a common set of jsdoc @typedef to this file
so we can use say something like this:

/**
   * A number with no fractional component.
   *
   * @see https://en.wikipedia.org/wiki/Integer
   * @typedef {number} integer
   */

/**
 * An RFC3349 Date.
 *
 * @see https://tools.ietf.org/html/rfc3349
 * @example 2020-02-03T15:09:01.023Z
 * @example new Date().toISOString()
 * @typedef {string} RFC3349Date
*/

in our projects and the linter and jsdoc documentation would be able to find it.
This would result in more informative documentation for developers and more readable
types in JsDoc comments.

By requiring this file in a .eslintrc.js file the linter will see it and jsdoc should see it if required.

P.S. this is not an immediate project, but rather something to consider when we have more time to pursue it.

Metadata

Metadata

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions