Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about use of object type spread #9

Closed
jnv opened this issue Feb 27, 2020 · 1 comment
Closed

Warn about use of object type spread #9

jnv opened this issue Feb 27, 2020 · 1 comment

Comments

@jnv
Copy link
Contributor

jnv commented Feb 27, 2020

The Flow codebase I work with uses object type spread heavily. Unfortunately this is not (yet) supported by TypeScript, so I don't expect any straightforward conversion here.

Currently Reflow silently drops the spreaded type, e.g. this:

type CustomProps = {|
  foo: string,
|}

type Props = {|
  ...CustomProps,
  bar: string,
|}

is converted to this:

type CustomProps = {
  foo: string,
}

type Props = {
  bar: string,
}

I think Reflow CLI could warn the user about the use of spread syntax. Also the README could mention that the syntax is not supported. What do you think?

@grubersjoe
Copy link
Owner

grubersjoe commented Mar 7, 2020

Thank you for your feedback! Of course properties should not simply be dropped silently. So I added a warning and adapted the README as you suggested 👍.

Reopen the issue if there are still problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants