-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Bug]: keywords allowed for identifiers in Typescript #14318
Copy link
Copy link
Closed
Labels
i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
require("@babel/parser").parse("function if({ const, while, with, let }){}",
{
sourceType: "module",
plugins: ["typescript"]
})RunKit link: https://runkit.com/tolmasky/keywords-as-identifiers-in-typescript
Configuration file name
No response
Configuration
No response
Current and expected behavior
Current behavior: no error
Expected behavior: Should throw an error.
Environment
- Babel 7.17.3
Possible solution
This is fixed in #14320
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue