facebook / facebook/relay

Provide option for `casting_syntax=as` for `relay.config.js` when `language` is `flow`

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

Description

We’d like to enable `casting_syntax=as` in our project’s `.flowconfig`, however the generated Flow types from the Relay compiler use the old `:` syntax, resulting in thousands of `invalid-type-cast-syntax` errors, which makes it difficult to identify the cases in our codebase that require updating.

It would be nice if there were an option for `relay.config.js` where we could opt-in to the new syntax, as it will eventually [become the default](https://medium.com/flow-type/new-type-casting-syntax-for-flow-as-3ef41567ff3e).

> At some point in the future we will remove the option and only support “as” casts, so code update your codebase!

Thanks for looking!

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.