-
Couldn't load subscription status.
- Fork 13.1k
Open
Labels
Domain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Description
π Search Terms
trailing comma dynamic import
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
declare module "foo" {}
const v = await import("foo",);
type T = typeof import("foo",);
const v2 = await import("foo",{},);
type T2 = typeof import("foo",{},);π Actual behavior
The trailing commas in the type-level import()s are reported as syntax error
π Expected behavior
The syntax of import() at the type-level should match the one at the value level, thus allowing trailing commas.
Additional information about the issue
Note that the error was correct before import attributes, but import attributes changed the dynamic import syntax to allow trailing commas.
kirkwaiblinger
Metadata
Metadata
Assignees
Labels
Domain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases