Skip to content

valid-types false positive for type-guard syntax #567

@Shinigami92

Description

@Shinigami92

Expected behavior

Should allow type guards

Working example:

image

Actual behavior

image

ESLint Config

{
  "extends": ["plugin:jsdoc/recommended"]
}

ESLint sample

/**
 * String Type-Guard
 *
 * @param {any} value Value
 * @returns {value is string} `true` if value is of type string, otherwise `false`
 */
function isString(value) {
  return typeof value === "string";
}

Environment

  • Node version: 14.4.0
  • ESLint version 7.1
  • eslint-plugin-jsdoc version: 27.0.4

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions