Merge branch 'v3.9.x'
# Conflicts: # package.json # tests/format/markdown/liquid/__snapshots__/format.test.js.snap # yarn.lock
This commit is contained in:
commit
811d268132
13 files changed
+253
-36
No files matched your search
@@ -5,6 +5,8 @@
|
||||
# See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt
|
||||
|
||||
# Prettier bump after release
|
||||
# 3.9.8
|
||||
88470cb79ca3b757dd6b93906d9a992aa1a456c3
|
||||
# 3.9.0
|
||||
bb817b1bd04c04e0a8d89cb52c256a38e17fd0f5
|
||||
# 3.7.0
|
||||
|
||||
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
|
||||
|
||||
-->
|
||||
|
||||
**Prettier 3.9.7**
|
||||
**Prettier 3.9.8**
|
||||
[Playground link](https://prettier.io/playground/#.....)
|
||||
|
||||
```sh
|
||||
|
||||
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
|
||||
|
||||
**Environments:**
|
||||
|
||||
- Prettier Version: 3.9.7
|
||||
- Prettier Version: 3.9.8
|
||||
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
|
||||
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
|
||||
- Operating System: <!-- Windows, Linux, macOS, etc. -->
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
# 3.9.8
|
||||
|
||||
[diff](https://github.com/prettier/prettier/compare/3.9.7...3.9.8)
|
||||
|
||||
#### Markdown: Don't let Liquid objects interrupt paragraphs ([#20087](https://github.com/prettier/prettier/pull/20087) by [@seiyab](https://github.com/seiyab))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```markdown
|
||||
<!-- Input -->
|
||||
If `module` is not a [`WebAssembly.Module`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
|
||||
<!-- Prettier 3.9.7 -->
|
||||
If `module` is not a [`WebAssembly.Module`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
|
||||
<!-- Prettier 3.9.8 -->
|
||||
If `module` is not a [`WebAssembly.Module`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
```
|
||||
|
||||
# 3.9.7
|
||||
|
||||
[diff](https://github.com/prettier/prettier/compare/3.9.6...3.9.7)
|
||||
|
||||
+1
-1
@@ -182,7 +182,7 @@
|
||||
"node-style-text": "2.1.2",
|
||||
"npm-run-all2": "9.0.3",
|
||||
"open-editor": "6.0.0",
|
||||
"prettier": "3.9.7",
|
||||
"prettier": "3.9.8",
|
||||
"pretty-bytes": "7.1.3",
|
||||
"pretty-ms": "9.3.1",
|
||||
"puppeteer": "25.11.0",
|
||||
|
||||
@@ -77,7 +77,7 @@ function liquidSyntax() {
|
||||
*/
|
||||
function tokenize(effects, ok, nok, mode) {
|
||||
const isFlow = mode === "flow";
|
||||
const { interrupt, now, parser } = this;
|
||||
const { now, parser } = this;
|
||||
/** @type {typeof codes.rightCurlyBrace | typeof codes.percentSign} */
|
||||
let closingCode;
|
||||
|
||||
@@ -97,7 +97,7 @@ function liquidSyntax() {
|
||||
? codes.percentSign
|
||||
: codes.rightCurlyBrace;
|
||||
effects.consume(code);
|
||||
return isFlow && interrupt ? ok : inside;
|
||||
return inside;
|
||||
default:
|
||||
return nok(code);
|
||||
}
|
||||
|
||||
@@ -547,6 +547,163 @@ For the sake of example, the router's public address is 5.6.7.8 and its private
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-20083.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
proseWrap: "always"
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
Taken from https://github.com/mdn/content/blob/3f221b9845703eb21db70cdc321f843d5c1c072b/files/en-us/webassembly/reference/javascript_interface/module/customsections_static/index.md?plain=1#L32-L33
|
||||
|
||||
If \`module\` is not a [\`WebAssembly.Module\`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} here is comment {% endcomment %}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} here is comment {{ endcomment }}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{abc}}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% tag %}
|
||||
|
||||
=====================================output=====================================
|
||||
Taken from
|
||||
https://github.com/mdn/content/blob/3f221b9845703eb21db70cdc321f843d5c1c072b/files/en-us/webassembly/reference/javascript_interface/module/customsections_static/index.md?plain=1#L32-L33
|
||||
|
||||
If \`module\` is not a
|
||||
[\`WebAssembly.Module\`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module)
|
||||
object instance, a {{jsxref("TypeError")}} is thrown.
|
||||
|
||||
---
|
||||
|
||||
text {% comment %} here is comment {% endcomment %}
|
||||
|
||||
---
|
||||
|
||||
text {{ comment }} here is comment {{ endcomment }}
|
||||
|
||||
---
|
||||
|
||||
text {% comment %} text
|
||||
|
||||
---
|
||||
|
||||
text {{ comment }} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{abc}}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% tag %}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-20083.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
Taken from https://github.com/mdn/content/blob/3f221b9845703eb21db70cdc321f843d5c1c072b/files/en-us/webassembly/reference/javascript_interface/module/customsections_static/index.md?plain=1#L32-L33
|
||||
|
||||
If \`module\` is not a [\`WebAssembly.Module\`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} here is comment {% endcomment %}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} here is comment {{ endcomment }}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{abc}}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% tag %}
|
||||
|
||||
=====================================output=====================================
|
||||
Taken from https://github.com/mdn/content/blob/3f221b9845703eb21db70cdc321f843d5c1c072b/files/en-us/webassembly/reference/javascript_interface/module/customsections_static/index.md?plain=1#L32-L33
|
||||
|
||||
If \`module\` is not a [\`WebAssembly.Module\`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} here is comment {% endcomment %}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} here is comment {{ endcomment }}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{abc}}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% tag %}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`unbalanced-mismatched-braces.md - {"proseWrap":"always"} format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
Taken from https://github.com/mdn/content/blob/3f221b9845703eb21db70cdc321f843d5c1c072b/files/en-us/webassembly/reference/javascript_interface/module/customsections_static/index.md?plain=1#L32-L33
|
||||
|
||||
If `module` is not a [`WebAssembly.Module`](/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module) object instance, a
|
||||
{{jsxref("TypeError")}} is thrown.
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} here is comment {% endcomment %}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} here is comment {{ endcomment }}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% comment %} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{ comment }} text
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{{abc}}
|
||||
|
||||
---
|
||||
|
||||
text
|
||||
{% tag %}
|
||||
@@ -332,7 +332,9 @@ function UsersSection() {
|
||||
<div>
|
||||
<p>
|
||||
More than{" "}
|
||||
<strong data-placeholder="dependent-github">10 million</strong>{" "}
|
||||
<strong data-placeholder="dependent-github">
|
||||
10.1 million
|
||||
</strong>{" "}
|
||||
dependent repositories on GitHub
|
||||
</p>
|
||||
<Link
|
||||
|
||||
@@ -21,7 +21,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@3.9.7/plugins](https://unpkg.com/browse/prettier@3.9.7/plugins). Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
|
||||
- **`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@3.9.8/plugins](https://unpkg.com/browse/prettier@3.9.8/plugins). Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
|
||||
|
||||
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
|
||||
|
||||
@@ -32,8 +32,8 @@ See below for examples.
|
||||
### Global
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/prettier@3.9.7/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@3.9.7/plugins/graphql.js"></script>
|
||||
<script src="https://unpkg.com/prettier@3.9.8/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@3.9.8/plugins/graphql.js"></script>
|
||||
<script>
|
||||
(async () => {
|
||||
const formatted = await prettier.format("type Query { hello: String }", {
|
||||
@@ -50,8 +50,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@3.9.7/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.7/plugins/graphql.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.8/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.8/plugins/graphql.mjs";
|
||||
|
||||
const formatted = await prettier.format("type Query { hello: String }", {
|
||||
parser: "graphql",
|
||||
@@ -64,8 +64,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
|
||||
|
||||
```js
|
||||
define([
|
||||
"https://unpkg.com/prettier@3.9.7/standalone.js",
|
||||
"https://unpkg.com/prettier@3.9.7/plugins/graphql.js",
|
||||
"https://unpkg.com/prettier@3.9.8/standalone.js",
|
||||
"https://unpkg.com/prettier@3.9.8/plugins/graphql.js",
|
||||
], async (prettier, ...plugins) => {
|
||||
const formatted = await prettier.format("type Query { hello: String }", {
|
||||
parser: "graphql",
|
||||
@@ -96,8 +96,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
|
||||
<TabItem value="module" label="Module worker">
|
||||
|
||||
```js
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.7/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.7/plugins/graphql.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.8/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.8/plugins/graphql.mjs";
|
||||
|
||||
const formatted = await prettier.format("type Query { hello: String }", {
|
||||
parser: "graphql",
|
||||
@@ -110,8 +110,8 @@ const formatted = await prettier.format("type Query { hello: String }", {
|
||||
|
||||
```js
|
||||
importScripts(
|
||||
"https://unpkg.com/prettier@3.9.7/standalone.js",
|
||||
"https://unpkg.com/prettier@3.9.7/plugins/graphql.js",
|
||||
"https://unpkg.com/prettier@3.9.8/standalone.js",
|
||||
"https://unpkg.com/prettier@3.9.8/plugins/graphql.js",
|
||||
);
|
||||
|
||||
(async () => {
|
||||
@@ -131,9 +131,9 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.7/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.7/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.7/plugins/estree.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.8/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.8/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.8/plugins/estree.mjs";
|
||||
|
||||
console.log(
|
||||
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
|
||||
@@ -149,10 +149,10 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.7/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.7/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.7/plugins/estree.mjs";
|
||||
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.9.7/plugins/html.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.9.8/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.8/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.8/plugins/estree.mjs";
|
||||
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.9.8/plugins/html.mjs";
|
||||
|
||||
console.log(
|
||||
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
|
||||
|
||||
@@ -12,35 +12,35 @@ First, install Prettier locally:
|
||||
<TabItem value="npm">
|
||||
|
||||
```bash
|
||||
npm install --save-dev --save-exact prettier@3.9.7
|
||||
npm install --save-dev --save-exact prettier@3.9.8
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="yarn">
|
||||
|
||||
```bash
|
||||
yarn add --dev --exact prettier@3.9.7
|
||||
yarn add --dev --exact prettier@3.9.8
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="pnpm">
|
||||
|
||||
```bash
|
||||
pnpm add --save-dev --save-exact prettier@3.9.7
|
||||
pnpm add --save-dev --save-exact prettier@3.9.8
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="bun">
|
||||
|
||||
```bash
|
||||
bun add --dev --exact prettier@3.9.7
|
||||
bun add --dev --exact prettier@3.9.8
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="deno">
|
||||
|
||||
```bash
|
||||
deno install --dev --save-exact prettier@3.9.7
|
||||
deno install --dev --save-exact prettier@3.9.8
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
@@ -46,7 +46,7 @@ Example `package.json`:
|
||||
"prettier": ">=3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "3.9.7"
|
||||
"prettier": "3.9.8"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -193,7 +193,7 @@ export default config;
|
||||
"prettier": ">=3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "3.9.7"
|
||||
"prettier": "3.9.8"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -8216,12 +8216,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"prettier@npm:3.9.7":
|
||||
version: 3.9.7
|
||||
resolution: "prettier@npm:3.9.7"
|
||||
"prettier@npm:3.9.8":
|
||||
version: 3.9.8
|
||||
resolution: "prettier@npm:3.9.8"
|
||||
bin:
|
||||
prettier: bin/prettier.cjs
|
||||
checksum: 10/f719bab860078a9d2472de9901529ffd1e3190963aeb246dee40de8d2fc60d66ec850c3bfc182475d63b9fd339bba8daa1ad500db8771ab4f5823a8da3f4546a
|
||||
checksum: 10/4ac262aaf9a5e221b02cc17447ebe7aa9689be59b85ab9de8152cd7422fb363ed3e09da6df585fa19ab1fc6cffebdc3ea34db1a75c978536aeba3f87bfd06ab3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -8349,7 +8349,7 @@ __metadata:
|
||||
postcss-scss: "npm:4.0.9"
|
||||
postcss-selector-parser: "npm:2.2.3"
|
||||
postcss-values-parser: "npm:2.0.1"
|
||||
prettier: "npm:3.9.7"
|
||||
prettier: "npm:3.9.8"
|
||||
pretty-bytes: "npm:7.1.3"
|
||||
pretty-ms: "npm:9.3.1"
|
||||
puppeteer: "npm:25.11.0"
|
||||
|
||||
Reference in new issue
Block a user