Skip to content

The import attributes should be preserved in .d.ts. #60736

@NWYLZW

Description

@NWYLZW

🔎 Search Terms

"import attributes", "import assert", "import with"

🕗 Version & Regression Information

  • This changed between versions 4.0 and latest
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAbzgVwM7AMowIY2HAXzgDMoIBbOAcimGwGMYq4B3ASxgAtFrbUIANshhsIAOwC05CABNgVAFzVpM5APmEAUJtCRYceuNTwkaYAGFsAgQCMGAa0JwAvHGwtsHOG3J6YACho6RioAGh52LiUkIP4hEXEpWXklIIBHZDZaZiICAEpNIA

💻 Code

export { useState } from 'react' with { 'resolution-mode': 'module' }

export const { useCallback } = await import('react', { with: { 'resolution-mode': 'require' } })

🙁 Actual behavior

.d.ts

export { useState } from 'react';
export declare const useCallback: typeof import("react").useCallback;

🙂 Expected behavior

.d.ts

export { useState } from 'react' with { 'resolution-mode': 'module' };
export declare const useCallback: typeof import("react", { with: { 'resolution-mode': 'require' } }).useCallback;

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions