prettier/tests/strings
Christopher Chedeau 8613046fd2 Respect template inline-ness (#1497)
In 1.3.0, we shipped a change that makes template literal always inlined as single arguments of a function. The problem with template literals is that they whitespace is significant so we can't change it. There are two cases:

```js
call(`
  template
  template
`);
```

and

```js
call(
  `template
   template`
);
```

If you always make the same decision to inline, you're going to be wrong for the other use case. The solution that I found that works is to figure out if there's a `\n` before the backtick `` ` ``. If that's the case, then don't inline, otherwise do. We're trying to avoid looking at the source as much as possible but this is one example where we actually don't have a choice if we want to keep the output sane.

1.3.0 made the jest codebase significantly worse because of this. The issue is that once things have been moved, this heuristic won't be able to undo it. So people need to have this fix applied before they run 1.3.0, otherwise it's going to damage their codebase unless they manually change everything back, which is a pain. So I'm going to land this as a hotfix in 1.3.1.

Fixes #1492
2017-05-03 14:35:58 -07:00
..
__snapshots__ Respect template inline-ness (#1497) 2017-05-03 14:35:58 -07:00
jsfmt.spec.js Eagerly evaluate `ifBreak` when processing template literals (fixes #795) (#798) 2017-02-23 21:21:13 -08:00
strings.js Eagerly evaluate `ifBreak` when processing template literals (fixes #795) (#798) 2017-02-23 21:21:13 -08:00
template-literals.js Eagerly evaluate `ifBreak` when processing template literals (fixes #795) (#798) 2017-02-23 21:21:13 -08:00