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

Support Typescript #48

Merged
merged 4 commits into from
Oct 4, 2018

Conversation

mathieuletyrant
Copy link
Contributor

@mathieuletyrant mathieuletyrant commented Oct 4, 2018

Closes #47

Copy link
Owner

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@@ -0,0 +1,6 @@
/* eslint-disable */

import i18n from 'i18n';
Copy link
Owner

@oliviertassinari oliviertassinari Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should write some specific TypeScript in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you right :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md Outdated
@@ -93,6 +93,7 @@ const keys = extractFromFiles([

- `marker`: The name of the internationalized string marker function. Defaults to `i18n`.
- `keyLoc`: An integer indicating the position of the key in the arguments. Defaults to `0`. Negative numbers, e.g., `-1`, indicate a position relative to the end of the argument list.
- `useTypescript`: Defaults to `false`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we respect the case useTypeScript?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's TypeScript over Typescript.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes you right !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@oliviertassinari oliviertassinari merged commit 981be28 into oliviertassinari:master Oct 4, 2018
Copy link
Contributor

@Kerumen Kerumen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small comment about the API of the library :)

@@ -93,6 +93,7 @@ const keys = extractFromFiles([

- `marker`: The name of the internationalized string marker function. Defaults to `i18n`.
- `keyLoc`: An integer indicating the position of the key in the arguments. Defaults to `0`. Negative numbers, e.g., `-1`, indicate a position relative to the end of the argument list.
- `useTypeScript`: Defaults to `false`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this boolean, maybe the API can be

parser: string with a default to flow?

This way it's extensible.

Of course this will need a throw if a unrecognized parser is passed.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an enum over a boolean is more future proof. It can be interesting if Babel adds a new language in the future or even if someone wants to disable the flow plugin. I'm all 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I open a PR? 😅

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathieuletyrant What do you think about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you right it's more futur proof :)

@oliviertassinari
Copy link
Owner

@mathieuletyrant Well done! I'm gonna do a release.

@Kerumen
Copy link
Contributor

Kerumen commented Oct 4, 2018

Too late 🙈

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