Expected behavior
Single-line @import jsdoc comments should be considered valid, and the import(s) visible to later @type etc jsdoc comments.
Actual behavior
A single-line @import comment triggers a Bad @import tag warning from jsdoc/check-values.
A later @type commment using that import triggers a The type '<type>' is undefined warning from jsdoc/no-undefined-types.
Neither of these warnings appear when using version 50.6.9 of the plugin, or if the @import tag is used in a multi-line comment.
ESLint Config
import jsdoc from 'eslint-plugin-jsdoc'
export default [
jsdoc.configs['flat/recommended'],
]
ESLint sample
This code generates warnings:
/** @import { ReactNode } from 'react' */
/** @type {ReactNode} */
export const TEST = null
This code does not generate warnings:
/**
* @import { ReactNode } from 'react'
*/
/** @type {ReactNode} */
export const TEST = null
Environment
- Node version: v23.10.0
- ESLint version: v9.25.1
eslint-plugin-jsdoc version: 50.6.10
Expected behavior
Single-line
@importjsdoc comments should be considered valid, and the import(s) visible to later@typeetc jsdoc comments.Actual behavior
A single-line
@importcomment triggers aBad @import tagwarning fromjsdoc/check-values.A later
@typecommment using that import triggers aThe type '<type>' is undefinedwarning fromjsdoc/no-undefined-types.Neither of these warnings appear when using version 50.6.9 of the plugin, or if the
@importtag is used in a multi-line comment.ESLint Config
ESLint sample
This code generates warnings:
This code does not generate warnings:
Environment
eslint-plugin-jsdocversion: 50.6.10