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

Change type to allow autocompletion and existence checking #1368

Merged
merged 2 commits into from
Jul 12, 2019
Merged

Change type to allow autocompletion and existence checking #1368

merged 2 commits into from
Jul 12, 2019

Conversation

robwalkerco
Copy link
Contributor

@robwalkerco robwalkerco commented Jul 12, 2019

The current types don't help the user with using defined messages.

The old DefinitelyTyped types supported this much better.

I'l updated the types in this project based on the DefinitelyTypes ones at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/696809615107a57fc0b2c4d8efacf60622486655/types/react-intl/index.d.ts#L44

With this change, you can autocomplete defined translations as well as receive a type error when you attempt to use a message this is not defined.

@longlho
Copy link
Member

longlho commented Jul 12, 2019

Thanks a lot for your contributions! Looks like the build is failing bc of prettier would u mind running it?

@robwalkerco
Copy link
Contributor Author

@longlho Sorry about that. I've run format:fix now

@longlho longlho merged commit 20d39e6 into formatjs:master Jul 12, 2019
@leoyli
Copy link
Contributor

leoyli commented Jul 12, 2019

That's really nice, was about to file the same things during the weekend. Looks like what I want to do have been already fixed. ❤️

Thanks!

@robwalkerco robwalkerco deleted the defineMessages-type branch July 15, 2019 09:32
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

Successfully merging this pull request may close these issues.

3 participants