from ... import ?
- Stage: Unstaged
- Status: Inactive
- ECMAScript edition: —
- Synchronized: Aug 28, 2026
- 中文译文 · Source repository
This proposal addresses the pain of code completion in the current order of import and from, and proposes the inverse syntax from . import . to allow better completion of module specifiers. The proposal also discusses edge cases such as imports without bindings and interaction with module attributes, and raises concerns about grammar growth and ASI-related issues.
The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.
from ... import ...;
Champion: Bradley Farias (@bmeck)
Stage: 0
Code completion is painful for the current order of import and from.
This proposal seeks to add the inverse to make code completion work.
Explanation
Status Quo
Could be a string for the module specier, or the list of imported binding.
- Tools cannot statically determine the list of possible bindings without the specifier, but it hasn't been added to the code yet.
- Tools can create a good completion by inserting the specifier, but doing so means a programmer needs to reposition the cursor to insert binding names which is the common case of imports.
Proposed
Module specifiers are the only thing that could be here to allow better code completion.
Imports without bindings
Just for posterity we can add the from prefixed form, even though it is more verbose:
Working with other proposals
Module attributes
The position of module attributes would still be at the end.
Concerns
- We would be growing the grammar without any new semantics added to the language.
- We would need to have different
[no LineTerminator here]rules in this form of import.
Due to from needing to be a contextual keyword it needs to avoid problems with ASI and would have a grammar like: