Merge branch 'main' into next

This commit is contained in:
Sosuke Suzuki committed 2022-12-08 22:00:17 +09:00
commit a8869bef55
45 files changed
+2794 -247

No files matched your search

+2 -2
View File
@@ -321,7 +321,7 @@ const UsersSection = ({ language }) => {
<div style={{ marginLeft: ".7em", width: "260px" }}>
<p>
More than{" "}
<strong data-placeholder="dependent-github">5 million</strong>{" "}
<strong data-placeholder="dependent-github">5.1 million</strong>{" "}
dependent repositories on GitHub
</p>
<Button href="https://github.com/prettier/prettier/network/dependents">
@@ -337,7 +337,7 @@ const UsersSection = ({ language }) => {
<div style={{ marginLeft: ".7em", width: "260px" }}>
<p>
More than{" "}
<strong data-placeholder="dependent-npm">12.7k</strong>{" "}
<strong data-placeholder="dependent-npm">12.8k</strong>{" "}
dependent packages on npm
</p>
<Button href="https://www.npmjs.com/browse/depended/prettier">
@@ -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.0/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.0/esm/>
- `parser-*.js` in <https://unpkg.com/browse/prettier@2.8.1/> and
- `parser-*.mjs` in <https://unpkg.com/browse/prettier@2.8.1/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.0/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.0/parser-graphql.js"></script>
<script src="https://unpkg.com/prettier@2.8.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.8.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/prettier@2.8.0/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.0/esm/parser-graphql.mjs";
import prettier from "https://unpkg.com/prettier@2.8.1/esm/standalone.mjs";
import parserGraphql from "https://unpkg.com/prettier@2.8.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/prettier@2.8.0/standalone.js",
"https://unpkg.com/prettier@2.8.0/parser-graphql.js",
"https://unpkg.com/prettier@2.8.1/standalone.js",
"https://unpkg.com/prettier@2.8.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/prettier@2.8.0/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.0/parser-graphql.js");
importScripts("https://unpkg.com/prettier@2.8.1/standalone.js");
importScripts("https://unpkg.com/prettier@2.8.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/prettier@2.8.0/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.0/esm/parser-babel.mjs";
import prettier from "https://unpkg.com/prettier@2.8.1/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.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/prettier@2.8.0/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.0/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.0/esm/parser-html.mjs";
import prettier from "https://unpkg.com/prettier@2.8.1/esm/standalone.mjs";
import parserBabel from "https://unpkg.com/prettier@2.8.1/esm/parser-babel.mjs";
import parserHtml from "https://unpkg.com/prettier@2.8.1/esm/parser-html.mjs";
console.log(
prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {