Merge branch 'main' into next
# Conflicts: # docs/browser.md # src/language-js/print/literal.js # src/language-js/print/misc.js # src/language-js/printer-estree.js # tests/format/markdown/auto-link/jsfmt.spec.js # yarn.lock
This commit is contained in:
commit
0cd7e10447
44 files changed
+1413
-459
No files matched your search
+13
-13
@@ -29,8 +29,8 @@ See below for examples.
|
||||
### Global
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/prettier@2.8.1/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@2.8.1/plugins/graphql.js"></script>
|
||||
<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>
|
||||
(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.1/standalone.mjs";
|
||||
import pluginGraphql from "https://unpkg.com/prettier@2.8.1/plugins/graphql.mjs";
|
||||
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";
|
||||
|
||||
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.1/standalone.js",
|
||||
"https://unpkg.com/prettier@2.8.1/plugins/graphql.js",
|
||||
"https://unpkg.com/prettier@2.8.2/standalone.js",
|
||||
"https://unpkg.com/prettier@2.8.2/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.1/standalone.js");
|
||||
importScripts("https://unpkg.com/prettier@2.8.1/plugins/graphql.js");
|
||||
importScripts("https://unpkg.com/prettier@2.8.2/standalone.js");
|
||||
importScripts("https://unpkg.com/prettier@2.8.2/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.1/standalone.mjs";
|
||||
import pluginBabel from "https://unpkg.com/prettier@2.8.1/plugins/babel.mjs";
|
||||
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";
|
||||
|
||||
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.1/standalone.mjs";
|
||||
import pluginBabel from "https://unpkg.com/prettier@2.8.1/plugins/babel.mjs";
|
||||
import pluginHtml from "https://unpkg.com/prettier@2.8.1/plugins/html.mjs";
|
||||
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";
|
||||
|
||||
console.log(
|
||||
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
|
||||
|
||||
Reference in new issue
Block a user