💻
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
Possible solution
This is fixed in #14320
Additional context
No response
💻
How are you using Babel?
Programmatic API (
babel.transform,babel.parse)Input code
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
Possible solution
This is fixed in #14320
Additional context
No response