-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Clone of this feature request, originally posted on jsdoc-type-pratt-parser.
Motivation
Typescript v5.5 introduces the tag @import, which allows importing types (or other stuff) within JSDoc:
/** @import { SomeType } from "some-module" */Would it be possible to add support for this new syntax?
Current behavior
With mode: "typescript"
types.js
export const allowImports = true; // Trick to allow importing
/** @typedef {string} TestOne */
/** @typedef {string} TestTwo */other.js
/**
* @import { TestOne, TestTwo } from "./types" 🡒 Syntax error in type: TestOne, TestTwo eslint(jsdoc/valid-types)
* @import { TestOne } from "./types" 🡒 The type 'TestOne' is undefined. eslint(jsdoc/no-undefined-types)
* @import * as Types from "./types" 🡒 No error
*/
// And regardless of the import used:
/**
* @typedef {TestOne} Test 🡒 The type 'TestOne' is undefined. eslint(jsdoc/no-undefined-types)
*/ Except for the errors, the imports works well.
Desired behavior
Being able to use @import without errors.