jenseng / react-i18nliner

translate="yes" all the things
MIT License
45 stars 15 forks source link

preserve whitespace when preprocessing #1

Open jenseng opened 9 years ago

jenseng commented 9 years ago

to facilitate debugging, we should preserve whitespace (or at least newlines) when converting a translate="yes" component to a <ComponentInterpolator> ... that way line numbers will match up with the original source. as it stands right now, recast is injecting some newlines, presumably for readability.

we handle this kinda rudimentarily in i18nliner (erb)

jenseng commented 9 years ago

this is slightly less critical, since we now share the same AST with i18nliner-js ... for i18nliner errors at least, the line numbers will be correct (since it uses the original loc.start)

that said, it's still nice to do for general js debugging