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

feat: format options for infusing #17

Merged
merged 2 commits into from
Nov 18, 2019
Merged

feat: format options for infusing #17

merged 2 commits into from
Nov 18, 2019

Conversation

antfu
Copy link
Member

@antfu antfu commented Nov 18, 2019

This PR introduces a new parameter for infusing. Allowing passing format options to the infuser.

The option type:

export type FormatOptions = {
  intend?: number, // default: 2
  eof?: string // default: "\n"
}

Currently the infuser will output like this

<i18n locale="en" lang="json5">
{
  id: 'User ID',
  password: 'Password'
}</i18n>

In this PR, the output will be: (by passing eof option, you would able to use Windows CRLF eol or disable eof totally)

<i18n locale="en" lang="json5">
{
  id: 'User ID',
  password: 'Password'
}
</i18n>

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Thanks a lot!
LGTM! 👍

@kazupon kazupon merged commit c6d1ef3 into intlify:master Nov 18, 2019
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.

None yet

2 participants