microsoft / microsoft/TypeScript
Should not allow `import.defer?.('x')`
Open
Nobody has claimed this yet.
Bug
Domain: Parser
Help Wanted
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔎 Search Terms
"import defer"
🕗 Version & Regression Information
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about 6.0.3_____
- I was unable to test this on prior versions because _______
⏯ Playground Link
💻 Code
import.defer?.('x');
🙁 Actual behavior
No errors.
🙂 Expected behavior
Should not allow it as an optional call.
Additional information about the issue
Parsers like Oxc, Yuku, SWC, Babel all reject it. I didn't read the spec, but unless they are wrong.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided TypeScript Playground link and the import.defer?.('x') example to reproduce the parser behavior. Trace the parser entry point for import-defer syntax and compare the handling with the rejecting behavior reported for Oxc, Yuku, SWC, and Babel. Done means this code is rejected rather than accepted as an optional call, with a regression test covering it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100