Merge branch 'main' into next

# Conflicts:
#	docs/browser.md
#	src/language-html/parser-html.js
#	src/language-js/print/jsx.js
#	src/language-js/print/typescript.js
#	website/yarn.lock
#	yarn.lock
This commit is contained in:
fisker Cheung committed 2023-01-16 15:53:36 +08:00
commit b332654039
18 files changed
+256 -58

No files matched your search

+13 -13
View File
@@ -29,8 +29,8 @@ See below for examples.
### Global
```html
<script src="https://unpkg.com/prettier@2.8.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.2/plugins/graphql.js"></script>
<script src="https://unpkg.com/prettier@2.8.3/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.3/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.2/standalone.mjs";
import pluginGraphql from "https://unpkg.com/prettier@2.8.2/plugins/graphql.mjs";
import * as prettier from "https://unpkg.com/prettier@2.8.3/standalone.mjs";
import pluginGraphql from "https://unpkg.com/prettier@2.8.3/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.2/standalone.js",
"https://unpkg.com/prettier@2.8.2/plugins/graphql.js",
"https://unpkg.com/prettier@2.8.3/standalone.js",
"https://unpkg.com/prettier@2.8.3/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.2/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.2/plugins/graphql.js");
importScripts("https://unpkg.com/prettier@2.8.3/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.3/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.2/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.2/plugins/babel.mjs";
import * as prettier from "https://unpkg.com/prettier@2.8.3/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.3/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.2/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.2/plugins/babel.mjs";
import pluginHtml from "https://unpkg.com/prettier@2.8.2/plugins/html.mjs";
import * as prettier from "https://unpkg.com/prettier@2.8.3/standalone.mjs";
import pluginBabel from "https://unpkg.com/prettier@2.8.3/plugins/babel.mjs";
import pluginHtml from "https://unpkg.com/prettier@2.8.3/plugins/html.mjs";
console.log(
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {