-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
π Search Terms
import specifier, property name, ModuleExportName, named import
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
Playground link with relevant code
π» Code
import { "useState" as useEffect } from "react";
π Actual behavior
Parser error
π Expected behavior
This should be parsed as valid code and properly type-checked. According to ES spec, ImportSpecifier
can be ModuleExportName as ImportedBinding
, where ModuleExportName
includes StringLiteral
.
Accordingly, this should be also allowed:
const a = 1;
export { a as "a-b" };
MartinJohns
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this