Merge remote-tracking branch 'remotes/upstream/patch-release'

# Conflicts:
#	.git-blame-ignore-revs
#	docs/browser.md
#	package.json
#	yarn.lock
This commit is contained in:
fisker Cheung committed 2023-04-23 15:59:21 +08:00
commit 0416ff42e2
8 files changed
+100 -37

No files matched your search

+2
View File
@@ -5,6 +5,8 @@
# See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt
# Prettier bump after release
# 2.8.8
fe8fcb5f9888ddbe9c749da01439dbdc7d28e367
# 2.8.7
0e26a75ebf0cb5b436f6a2d26a7bb88d04f23b90
# 2.8.6
+1 -1
View File
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
-->
**Prettier 2.8.7**
**Prettier 2.8.8**
[Playground link](https://prettier.io/playground/#.....)
```sh
+1 -1
View File
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
**Environments:**
- Prettier Version: 2.8.7
- Prettier Version: 2.8.8
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
+61
View File
@@ -1,3 +1,64 @@
# 2.8.8
[diff](https://github.com/prettier/prettier/compare/2.8.7...2.8.8)
#### Allow decorators on private members and class expressions ([#14548](https://github.com/prettier/prettier/pull/14548) by [@fisker](https://github.com/fisker))
<!-- prettier-ignore -->
```ts
// Input
class A {
@decorator()
#privateMethod () {}
}
// Prettier 2.8.7
SyntaxError: Decorators are not valid here. (2:3)
1 | class A {
> 2 | @decorator()
| ^^^^^^^^^^^^
3 | #privateMethod () {}
4 | }
// Prettier 2.8.8
class A {
@decorator()
#privateMethod() {}
}
```
#### Allow multiple decorators on same getter/setter ([#14584](https://github.com/prettier/prettier/pull/14584) by [@fisker](https://github.com/fisker))
<!-- prettier-ignore -->
```ts
// Input
class A {
@decorator()
get foo () {}
@decorator()
set foo (value) {}
}
// Prettier 2.8.7
SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. (5:3)
3 | get foo () {}
4 |
> 5 | @decorator()
| ^^^^^^^^^^^^
6 | set foo (value) {}
7 | }
// Prettier 2.8.8
class A {
@decorator()
get foo() {}
@decorator()
set foo(value) {}
}
```
# 2.8.7
[diff](https://github.com/prettier/prettier/compare/2.8.6...2.8.7)
+14 -14
View File
@@ -18,7 +18,7 @@ Required options:
- **[`parser`](options.md#parser) (or [`filepath`](options.md#file-path))**: One of these options has to be specified for Prettier to know which parser to use.
- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files in <https://unpkg.com/browse/prettier@2.8.7/plugins/>
- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files in <https://unpkg.com/browse/prettier@2.8.8/plugins/>
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
@@ -29,8 +29,8 @@ See below for examples.
### Global
```html
<script src="https://unpkg.com/prettier@2.8.7/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.7/plugins/graphql.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/plugins/graphql.js"></script>
<script>
(async () => {
const formatted = await prettier.format("type Query { hello: String }", {
@@ -47,8 +47,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
```html
<script type="module">
import * as prettier from "https://unpkg.com/prettier@2.8.7/standalone.mjs";
import pluginGraphql from "https://unpkg.com/prettier@2.8.7/plugins/graphql.mjs";
import * as prettier from "https://unpkg.com/prettier@2.8.8/standalone.mjs";
import pluginGraphql from "https://unpkg.com/prettier@2.8.8/plugins/graphql.mjs";
const formatted = await prettier.format("type Query { hello: String }", {
parser: "graphql",
@@ -61,8 +61,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
```js
define([
"https://unpkg.com/prettier@2.8.7/standalone.js",
"https://unpkg.com/prettier@2.8.7/plugins/graphql.js",
"https://unpkg.com/prettier@2.8.8/standalone.js",
"https://unpkg.com/prettier@2.8.8/plugins/graphql.js",
], async (prettier, ...plugins) => {
const formatted = await 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/prettier@2.8.7/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.7/plugins/graphql.js");
importScripts("https://unpkg.com/prettier@2.8.8/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.8/plugins/graphql.js");
(async () => {
const formatted = await prettier.format("type Query { hello: String }", {
parser: "graphql",
@@ -105,8 +105,8 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
```html
<script type="module">
import * as prettier from "https://unpkg.com/prettier@2.8.7/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.7/plugins/babel.mjs";
import * as prettier from "https://unpkg.com/prettier@2.8.8/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.8/plugins/babel.mjs";
console.log(
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -122,9 +122,9 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
```html
<script type="module">
import * as prettier from "https://unpkg.com/prettier@2.8.7/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.7/plugins/babel.mjs";
import pluginHtml from "https://unpkg.com/prettier@2.8.7/plugins/html.mjs";
import * as prettier from "https://unpkg.com/prettier@2.8.8/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.8/plugins/babel.mjs";
import pluginHtml from "https://unpkg.com/prettier@2.8.8/plugins/html.mjs";
console.log(
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
+1 -1
View File
@@ -142,7 +142,7 @@
"magic-string": "0.30.0",
"npm-run-all": "4.1.5",
"path-browserify": "1.0.1",
"prettier": "2.8.7",
"prettier": "2.8.8",
"pretty-bytes": "6.1.0",
"rollup-plugin-license": "3.0.1",
"semver": "7.3.8",
@@ -21,8 +21,8 @@ Required options:
- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files named
- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.7/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.7/esm/>
- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.8/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.8/esm/>
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
@@ -33,8 +33,8 @@ See below for examples.
### Global
```html
<script src="https://unpkg.com/prettier@2.8.7/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.7/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.8/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/prettier@2.8.7/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.7/esm/parser-graphql.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.8/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/prettier@2.8.7/standalone.js",
"https://unpkg.com/prettier@2.8.7/parser-graphql.js",
"https://unpkg.com/prettier@2.8.8/standalone.js",
"https://unpkg.com/prettier@2.8.8/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/prettier@2.8.7/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.7/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.8.8/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.8/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/prettier@2.8.7/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.7/esm/parser-babel.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.8/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/prettier@2.8.7/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.7/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.7/esm/parser-html.mjs";
import prettier from "https://unpkg.com/prettier@2.8.8/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.8/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.8/esm/parser-html.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
+5 -5
View File
@@ -6699,12 +6699,12 @@ __metadata:
languageName: node
linkType: hard
"prettier@npm:2.8.7":
version: 2.8.7
resolution: "prettier@npm:2.8.7"
"prettier@npm:2.8.8":
version: 2.8.8
resolution: "prettier@npm:2.8.8"
bin:
prettier: bin-prettier.js
checksum: fdc8f2616f099f5f0d685907f4449a70595a0fc1d081a88919604375989e0d5e9168d6121d8cc6861f21990b31665828e00472544d785d5940ea08a17660c3a6
checksum: b49e409431bf129dd89238d64299ba80717b57ff5a6d1c1a8b1a28b590d998a34e083fa13573bc732bb8d2305becb4c9a4407f8486c81fa7d55100eb08263cf8
languageName: node
linkType: hard
@@ -6808,7 +6808,7 @@ __metadata:
postcss-scss: 4.0.6
postcss-selector-parser: 2.2.3
postcss-values-parser: 2.0.1
prettier: 2.8.7
prettier: 2.8.8
pretty-bytes: 6.1.0
regexp-util: 1.2.2
remark-footnotes: 2.0.0