[Bug]: Babel with Typescript produces functions for an empty namespaces. #14947
Labels
area: typescript
i: enhancement
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
馃捇
How are you using Babel?
babel-loader (webpack)
Input code
Configuration file name
.babelrc
Configuration
Current and expected behavior
Current behavior:
Babel produces consts and empty functions for these namespaces.
Expected behavior:
Babel should ignore them the same way as TypeScript compiler does.
This is useful when you have a React component and a namespace with the same name containing the
Props
interface inside. This allows you toimport { ComponentName } from './ComponentName'
without additional import forProps
type by accessing it withComponentName.Props
. Such namespace exists in types scope only and should not affect the resulting code. There is no sense and use of such function produced from these empty namespaces, it's just garbage.Environment
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: