Skip to content

A type like {(el: HTMLElement) => Promise<void>|void} no longer allowed in 28.0.0 #592

@doberkofler

Description

@doberkofler

Expected behavior

Recognize the valid type as before in 27.1.2

Actual behavior

warning: Syntax error in type: (el: HTMLElement) => Promise<void>|void (jsdoc/valid-types) at src/framework/module/index.ts:
  76 |  * Specify the function to execute when loading a react page.
  77 |  *
> 78 |  * @param {(el: HTMLElement) => Promise<void>|void} render - A function that will render the page when the DOM is ready.
     | ^
  79 |  * @example newReactPage({console.log('DOM is ready');});
  80 |  */
  81 | export function newReactPage(render: (el: HTMLElement) => Promise<void>|void): void {

ESLint Config

'jsdoc/valid-types': 'warn'

ESLint sample

/**
 * Specify the function to execute when loading a react page.
 *
 * @param {(el: HTMLElement) => Promise<void>|void} render - A function that will render the page when the DOM is ready.
 * @example newReactPage({console.log('DOM is ready');});
 */
export function newReactPage(render: (el: HTMLElement) => Promise<void>|void): void {
}

Environment

  • Node version: 14.4.0
  • ESLint version 7.3.0
  • eslint-plugin-jsdoc version: 28.0.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions