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 multiline template literals #2527
Comments
The primary reason is that it intentionally preserves trailing whitespaces in the middle of your sentences so it basically has built-in footgun there. In your example when it got sent to translation vendor it'll become something like |
I could be mistaken but it looks like I just checked and |
ts-transformer did it primarily bc of historical reasons. In cases where IDs are autogen as hash from |
Fair enough makes sense. In that case, if the concatenation of string literals is the ordained way to do multi-line |
hmm we can't actually extract string literals concat. So it's basically would have to be a long string, or broken up into sentences. |
Hmm, not sure I follow... Doesn't this change 24454ba add support for extracting static string concat static? |
You're right. I confused myself. We do support that :) |
Had a discussion internally. This is something we can support. |
Awesome, thank you! |
Which package?
ts-transformer, eslint-plugin-formatjs
Is your feature request related to a problem? Please describe.
Similar to #2252
Right now if you do something like this with a template literal to split the defaultMessage across multiple lines,
eslint-plugin-formatjs/enforce-default-message
will error since it's not a string literal or concatenation of string literals.Describe the solution you'd like
Ideally, since this a template literal containing no expressions, it is static and should be treated like a string literal.
Eslint should not error and the developer should be able to extract the message using the cli.
Sure a developer could just use the concatenated string literals solution but I think it would be more intuitive to support both. Unless you can think of a reason not to. Happy to try to open a PR for this.
The text was updated successfully, but these errors were encountered: