Thanks to visit codestin.com
Credit goes to github.com

Skip to content

formatjs: concatenated strings break (unlike babel) #446

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

Open
elado opened this issue May 7, 2025 · 0 comments
Open

formatjs: concatenated strings break (unlike babel) #446

elado opened this issue May 7, 2025 · 0 comments

Comments

@elado
Copy link

elado commented May 7, 2025

Describe the bug

When having multiple literal strings concatenated, e.g.

defineMessage({
  defaultMessage: "Foo " + "Bar",
  description: "foobar",
})

(normally happens when the strings are long and span over multiple lines).

The result of the compilation is:

defineMessage({
  defaultMessage: ""
})

Repro: https://github.com/elado/swc-formatjs-bug-1

Expected behavior

The SWC plugin should behave like Babel's.
It should allow "x" + "y" inputs to defaultMessage/description and treat it like a full string.

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

No branches or pull requests

1 participant