### TypeScript: Keep trailing comma in tsx type parameters ([#6115] by [@sosukesuzuki])
Previously, a trailing comma after single type parameter in arrow function was cleaned up. The formatted result is valid as ts, but is invalid as tsx. Prettier master fixes this issue.
### JavaScript: Fix closure typecasts without spaces ([#6116] by [@jridgewell])
Previously, a space was required between the `@type` and opening `{` of a closure typecast, or else the enclosing parenthesis would be removed. Closure itself does not require a space.
### JavaScript: Prevent adding quotes when using `--quote-props=consistent` and objects had numbers or computed expressions as keys ([#6119] and [#6138] by [@duailibe])
Previously, Prettier added unnecessary quotes to keys of an object, or properties and methods of classes, if there was at least one computed key with a "complex" expression (e.g. a member expression) or a numeric literal.
### JavaScript: Add parenthesis in JSX spread element with logical expressions ([#6130] by [@duailibe])
Previously, Prettier didn't add parenthesis in JSX spread elements because they aren't necessary, but for the sake of consistency with spread operator in objects and arrays, we'll add to JSX as well.
### Markdown: correctly determine count of backticks in inline code ([#6110] by [@belochub])
By the CommonMark spec, it is required to 'choose a string of `n` backtick characters as delimiters, where the code does not contain any strings of exactly `n` backtick characters.'
This changes the method of finding the required count of backticks from using 2 backticks, when there is a backtick string of length 1 inside the inline code block, and using 1 backtick in all other cases, to finding a minimum length backtick string that can correctly be used as a delimiter.
### JavaScript: Stop converting empty JSX elements to self-closing elemnts ([#6127] by [@duailibe])
Prettier has always converted empty JSX elements (`<div></div>`) to self-closing elements (`<div/>`) because those are equivalent.
We have received feedback that during development, one would like to type the opening and closing tags and leave them to add the children later, but Prettier would convert it to a self-closing element, forcing the developer to manually convert them back. This has changed in this release.
### API: Prettier now works in Atom again ([#6129] by [@duailibe])
Atom has a security feature where code containing `eval` is not allowed to be run. One of Prettier's dependencies uses `eval` to prevent bundlers from including debug code. We've now made sure that this `eval` does not end up in the code we ship to npm, making Prettier play nice with Atom again.
### JavaScript: Add support for styled-jsx external styles ([#6089] by [@hongrich])
Add support for 2 external styles tags in `styled-jsx/css`: `css.global`, and `css.resolve`. https://github.com/zeit/styled-jsx/#external-css-and-styles-outside-of-the-component
The `css` template tag is already supported by Prettier.
### JavaScript: Keep parenthesis around functions and classes in `export default` declarations ([#6133] by [@duailibe])
Prettier was removing parenthesis from some expressions in `export default`, but if those are complex expressions that start with `function` or `class`, the parenthesis are required.
See below some practical examples, including one affecting TypeScript.
<!-- prettier-ignore -->
```ts
// Input
export default (function log() {}).toString();
export default (function log() {} as typeof console.log);
// Output (Prettier stable)
export default function log() {}.toString();
export default function log() {} as typeof console.log; // syntax error
// Output (Prettier master)
export default (function log() {}).toString();
export default (function log() {} as typeof console.log);
### Javascript: Address parentheses bugs for edge cases with call and new. ([#6148] by [@bakkot])
Adding all and only the necessary parentheses when mixing `new` with function calls is tricky. This change fixes two issues where necessary parentheses were omitted and one when redundant parentheses were added.
### JavaScript: Fix nested embeds (JS in HTML in JS) ([#6038] by [@thorn0])
Previously, if JS code embedded in HTML (via `<script>`) embedded in JS (via a template literal) contained template literals, the inner JS was not formatted.
<!-- prettier-ignore -->
```js
// Input
const html = /* HTML */ `<script>var a=\`\`</script>`;
### Handlebars: Avoid adding unwanted whitespace after components ([#6178] by [@GavinJoyce])
Previously, Prettier added a space before `/>` and a line break after, even when at the start of a line. Now, that extra space and line break is no longer present.