-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Redesign types directives #12311
Comments
Ref #11334 We wouldn't be able to eliminate old directives for a long long time, just deprecated them. Also, there are loads we can't control which we have to support, so there will always be inconsistency. So creating more inconstiancy (by depreciating one and introducing another) doesn't make sense to me personally. Also, it isn't "export" types persay as much as just the "type" version of the runtime code. We have an issue for supporting |
Inconsistency across existing code from alternate legacy syntax is not the kind I'm talking about because IMO that's not much of a real problem for users, but inconsistency across idiomatic syntaxes where the two standouts are also bad for independent reasons means there exists no reasonably written way of invoking that behaviour.
It seems close enough. I don't think there's any other way of deferring the export types of a JS module, it's the intended purpose and the picture painted by https://deno.land/[email protected]/typescript/types#providing-types-when-hosting. From scratch I would use |
I don't think we should make any changes to these. It's unfortunate they exist because they're not standard typescript directives. I think it would be better if we petition for something to be adopted in TypeScript itself (microsoft/TypeScript#33437). |
Going to close this because I think we should discuss in that TypeScript issue, so let's track and discuss this there. Note: This could be done with import attributes microsoft/TypeScript#33437 (comment) |
Adding types to
.js
import-sideCurrent syntax
The syntax is inconsistent with Deno's other directives and the name is vague.
Proposal
Adding types to
.js
export-sideCurrent syntax
Same problems. This has no relation to the
/// reference types
in tsc whose syntax it borrows, bears no similarity to the import-side directive and has a vague name.Proposal
We should support the proposed directives.
deno lint
should deprecate// @deno-types
and/// <reference types="<module-specifier-like>">
The text was updated successfully, but these errors were encountered: