JSX - Add toggle for FB translation pipeline compatibility
See original GitHub issueExtracted from https://github.com/prettier/prettier/pull/1831
Currently we don’t break between text and tags/expressions when there is no existing white space. This is not the ideal behaviour in most cases, but was added to make Prettier compatible with the Facebook translation pipeline (see https://github.com/prettier/prettier/issues/1581#issuecomment-300975032 for more detail).
With translation pipeline compatibility:
<div>
before<div>
<a>content</a>
</div>after
</div>
Without:
<div>
before
<div>
<a>content</a>
</div>
after
</div>
It would seem sensible to make the behaviour toggle-able and disabled by default. This way projects that don’t need compatibility with the Facebook translation pipeline (which should be most of them) can have slightly nicer formatting.
Having compatibility turned off should make it easier to improve the formatting in https://github.com/prettier/prettier/issues/2231
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
No worries! There is always stuff like this when a spec meets real world use 😀
I’ve slowly been coming to the same realisation that the current master isn’t going to work for FB. I’ll have a look and see what the quickest fix is to unblock this.
Once we’ve got the release out that will give us time to investigate other approaches without a pressing time constraint.