-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSdoc 'import type' syntax wrongly transformed when generate declaration from js file #46575
Comments
|
Yes. In a type position, we use |
JSDoc is used to only give type-hints in TypeScript and JavaScript files, not to direct how the syntax should change. I'm afraid any changes here would be massively breaking to the ecosystem, and break the TypeScript design guides which were mentioned in the issue template. |
But I think it's weird to have each single feature works fine but break when use them both. (because I think maybe we could handle this by replace |
Working as intended for now, but there’s an issue tracking an investigation into whether we can do this: #44044 (As an aside, it feels slightly weird to me that the JSDoc |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
🔎 Search Terms
Import type syntax error after generate .d.ts from js
Import type error after generate .d.ts using JSdoc
🕗 Version & Regression Information
💻 Code
demo repo (using 'import-types' branch, not 'master')
🙁 Actual behavior
output index.d.ts
import
is a method for loading async resource in js/ts, not import a type. it should be transformed toimport .. from ..
.🙂 Expected behavior
output index.d.ts
The text was updated successfully, but these errors were encountered: