-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
importtype, import type parsing
π Version & Regression Information
- This changed between versions 4.6.4 and 4.7.4 (with the old
assertkeyword)
β― Playground Link
π» Code
declare module "wat";
type _ = typeof import("wat", {
assert: {
a: (() => {
console.log("why can you write js here????");
})(),
}
});π Actual behavior
parser accepts arbitrary JS expressions inside a type expression
π Expected behavior
parser only allows string literal values or arbitrary type values
Additional information about the issue
No response
Josh-Cena
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorHelp WantedYou can do thisYou can do this