facebook / facebook/relay

Kebab-cased file names cause unexpected camel cased naming for generated Typescript types

Open
#3,081 9 comments 7 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

In my pet project I happen to name my folder and files with kebab case, similar to how Angular does it, and end up with a module called `home-page.tsx`. The compiler therefore enforces the query inside that file to be called `homePageQuery` and unfortunately the generated Typescript type is cased the same in contrast to the usual pascal casing of type names.

This means I either accept camel cased type names, rename all of my files from kebab case to pascal case or write a custom transformer script that renames the types accordingly. Therefore I feel like this is a bit of an oversight and would like to know whether there are any options or possible fixes to have the generated Typescript types be in pascal case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.