-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29f408c
commit 56ed71d
Showing
6 changed files
with
94 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,68 @@ | ||
# 2.5.1 | ||
|
||
[diff](https://github.com/prettier/prettier/compare/2.5.0...2.5.1) | ||
|
||
#### Improve formatting for empty tuple types ([#11884](https://github.com/prettier/prettier/pull/11884) by [@sosukesuzuki](https://github.com/sosukesuzuki)) | ||
|
||
<!-- prettier-ignore --> | ||
```tsx | ||
// Input | ||
type Foo = | ||
Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends [] | ||
? Foo3 | ||
: Foo4; | ||
|
||
// Prettier 2.5.0 | ||
type Foo = Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends [ | ||
|
||
] | ||
? Foo3 | ||
: Foo4; | ||
|
||
// Prettier 2.5.0 (tailingCommma = all) | ||
// Invalid TypeScript code | ||
type Foo = Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends [ | ||
, | ||
] | ||
? Foo3 | ||
: Foo4; | ||
|
||
// Prettier 2.5.1 | ||
type Foo = | ||
Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo extends [] | ||
? Foo3 | ||
: Foo4; | ||
|
||
``` | ||
|
||
#### Fix compatibility with Jest inline snapshot test ([#11892](https://github.com/prettier/prettier/pull/11892) by [@fisker](https://github.com/fisker)) | ||
|
||
A internal change in [email protected] accidentally breaks the Jest inline snapshot test. | ||
|
||
#### Support Glimmer's named blocks ([#11899](https://github.com/prettier/prettier/pull/11899) by [@duailibe](https://github.com/duailibe)) | ||
|
||
Prettier already supported this feature, but it converted empty named blocks to self-closing, which is not supported by the Glimmer compiler. | ||
|
||
See: [Glimmer's named blocks](https://emberjs.github.io/rfcs/0460-yieldable-named-blocks.html). | ||
|
||
<!-- prettier-ignore --> | ||
```hbs | ||
// Input | ||
<Component> | ||
<:named></:named> | ||
</Component> | ||
|
||
// Prettier 2.5.0 | ||
<Component> | ||
<:named /> | ||
</Component> | ||
|
||
// Prettier 2.5.1 | ||
<Component> | ||
<:named></:named> | ||
</Component> | ||
``` | ||
|
||
# 2.5.0 | ||
|
||
[diff](https://github.com/prettier/prettier/compare/2.4.1...2.5.0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,8 @@ See below for examples. | |
### Global | ||
|
||
```html | ||
<script src="https://unpkg.com/[email protected].0/standalone.js"></script> | ||
<script src="https://unpkg.com/[email protected].0/parser-graphql.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/standalone.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/parser-graphql.js"></script> | ||
<script> | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
|
@@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack | |
|
||
```html | ||
<script type="module"> | ||
import prettier from "https://unpkg.com/[email protected].0/esm/standalone.mjs"; | ||
import parserGraphql from "https://unpkg.com/[email protected].0/esm/parser-graphql.mjs"; | ||
import prettier from "https://unpkg.com/[email protected].1/esm/standalone.mjs"; | ||
import parserGraphql from "https://unpkg.com/[email protected].1/esm/parser-graphql.mjs"; | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
|
@@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack | |
|
||
```js | ||
define([ | ||
"https://unpkg.com/[email protected].0/standalone.js", | ||
"https://unpkg.com/[email protected].0/parser-graphql.js", | ||
"https://unpkg.com/[email protected].1/standalone.js", | ||
"https://unpkg.com/[email protected].1/parser-graphql.js", | ||
], (prettier, ...plugins) => { | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
|
@@ -88,8 +88,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b | |
### Worker | ||
|
||
```js | ||
importScripts("https://unpkg.com/[email protected].0/standalone.js"); | ||
importScripts("https://unpkg.com/[email protected].0/parser-graphql.js"); | ||
importScripts("https://unpkg.com/[email protected].1/standalone.js"); | ||
importScripts("https://unpkg.com/[email protected].1/parser-graphql.js"); | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
plugins: prettierPlugins, | ||
|
@@ -102,8 +102,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting), | |
|
||
```html | ||
<script type="module"> | ||
import prettier from "https://unpkg.com/[email protected].0/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].0/esm/parser-babel.mjs"; | ||
import prettier from "https://unpkg.com/[email protected].1/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs"; | ||
console.log( | ||
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { | ||
|
@@ -119,9 +119,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser | |
|
||
```html | ||
<script type="module"> | ||
import prettier from "https://unpkg.com/[email protected].0/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].0/esm/parser-babel.mjs"; | ||
import parserHtml from "https://unpkg.com/[email protected].0/esm/parser-html.mjs"; | ||
import prettier from "https://unpkg.com/[email protected].1/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs"; | ||
import parserHtml from "https://unpkg.com/[email protected].1/esm/parser-html.mjs"; | ||
console.log( | ||
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,8 @@ See below for examples. | |
### Global | ||
|
||
```html | ||
<script src="https://unpkg.com/[email protected].0/standalone.js"></script> | ||
<script src="https://unpkg.com/[email protected].0/parser-graphql.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/standalone.js"></script> | ||
<script src="https://unpkg.com/[email protected].1/parser-graphql.js"></script> | ||
<script> | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
|
@@ -49,8 +49,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack | |
|
||
```html | ||
<script type="module"> | ||
import prettier from "https://unpkg.com/[email protected].0/esm/standalone.mjs"; | ||
import parserGraphql from "https://unpkg.com/[email protected].0/esm/parser-graphql.mjs"; | ||
import prettier from "https://unpkg.com/[email protected].1/esm/standalone.mjs"; | ||
import parserGraphql from "https://unpkg.com/[email protected].1/esm/parser-graphql.mjs"; | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
|
@@ -63,8 +63,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack | |
|
||
```js | ||
define([ | ||
"https://unpkg.com/[email protected].0/standalone.js", | ||
"https://unpkg.com/[email protected].0/parser-graphql.js", | ||
"https://unpkg.com/[email protected].1/standalone.js", | ||
"https://unpkg.com/[email protected].1/parser-graphql.js", | ||
], (prettier, ...plugins) => { | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
|
@@ -89,8 +89,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b | |
### Worker | ||
|
||
```js | ||
importScripts("https://unpkg.com/[email protected].0/standalone.js"); | ||
importScripts("https://unpkg.com/[email protected].0/parser-graphql.js"); | ||
importScripts("https://unpkg.com/[email protected].1/standalone.js"); | ||
importScripts("https://unpkg.com/[email protected].1/parser-graphql.js"); | ||
prettier.format("type Query { hello: String }", { | ||
parser: "graphql", | ||
plugins: prettierPlugins, | ||
|
@@ -103,8 +103,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting), | |
|
||
```html | ||
<script type="module"> | ||
import prettier from "https://unpkg.com/[email protected].0/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].0/esm/parser-babel.mjs"; | ||
import prettier from "https://unpkg.com/[email protected].1/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs"; | ||
console.log( | ||
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { | ||
|
@@ -120,9 +120,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser | |
|
||
```html | ||
<script type="module"> | ||
import prettier from "https://unpkg.com/[email protected].0/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].0/esm/parser-babel.mjs"; | ||
import parserHtml from "https://unpkg.com/[email protected].0/esm/parser-html.mjs"; | ||
import prettier from "https://unpkg.com/[email protected].1/esm/standalone.mjs"; | ||
import parserBabel from "https://unpkg.com/[email protected].1/esm/parser-babel.mjs"; | ||
import parserHtml from "https://unpkg.com/[email protected].1/esm/parser-html.mjs"; | ||
console.log( | ||
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", { | ||
|