Merge branch 'v3.9.x'

This commit is contained in:
fisker committed 2026-06-28 07:11:09 +08:00
commit 440b36c03c
10 files changed
+69 -65

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
-->
**Prettier 3.9.0**
**Prettier 3.9.1**
[Playground link](https://prettier.io/playground/#.....)
```sh
+1 -1
View File
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
**Environments:**
- Prettier Version: 3.9.0
- Prettier Version: 3.9.1
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
+8
View File
@@ -1,3 +1,11 @@
# 3.9.1
[diff](https://github.com/prettier/prettier/compare/3.9.0...3.9.1)
#### CLI: Fix ignored file has been cached incorrectly ([#19483](https://github.com/prettier/prettier/pull/19483) by [@kovsu](https://github.com/kovsu))
Bug details https://github.com/prettier/prettier/issues/18016
# 3.9.0
[diff](https://github.com/prettier/prettier/compare/3.8.5...3.9.0)
+2 -2
View File
@@ -71,7 +71,7 @@
"espree": "11.2.0",
"fast-glob": "3.3.3",
"fast-json-stable-stringify": "2.1.0",
"file-entry-cache": "11.1.3",
"file-entry-cache": "11.1.5",
"find-cache-directory": "6.0.0",
"flow-parser": "0.321.0",
"get-east-asian-width": "1.6.0",
@@ -179,7 +179,7 @@
"node-style-text": "2.1.2",
"npm-run-all2": "9.0.2",
"open-editor": "6.0.0",
"prettier": "3.9.0",
"prettier": "3.9.1",
"pretty-bytes": "7.1.0",
"pretty-ms": "9.3.0",
"puppeteer": "25.2.1",
+1 -1
View File
@@ -18,7 +18,7 @@ const entries = fs
.readdirSync(changelogUnreleasedDirectory, { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.flatMap((dir) => {
const dirPath = path.join(dir.path, dir.name);
const dirPath = path.join(dir.parentPath, dir.name);
const { title } = categories.find((category) => category.dir === dir.name);
return getEntries(dirPath).map((entry) => {
-4
View File
@@ -321,10 +321,6 @@ async function formatFiles(context) {
context.argv.check ||
context.argv.listDifferent)
) {
// If the file is ignored remove it from the cache
// - it won't be formatted anymore
// - if it has been restored, we shouldn't keep the old cache entry
formatResultsCache?.removeFormatResultsCache(filename);
continue;
}
@@ -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.0/plugins](https://unpkg.com/browse/prettier@3.9.0/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.1/plugins](https://unpkg.com/browse/prettier@3.9.1/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.0/standalone.js"></script>
<script src="https://unpkg.com/prettier@3.9.0/plugins/graphql.js"></script>
<script src="https://unpkg.com/prettier@3.9.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@3.9.1/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.0/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.0/plugins/graphql.mjs";
import * as prettier from "https://unpkg.com/prettier@3.9.1/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.1/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.0/standalone.js",
"https://unpkg.com/prettier@3.9.0/plugins/graphql.js",
"https://unpkg.com/prettier@3.9.1/standalone.js",
"https://unpkg.com/prettier@3.9.1/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.0/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.01/plugins/graphql.mjs";
import * as prettier from "https://unpkg.com/prettier@3.9.1/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.9.11/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.0/standalone.js",
"https://unpkg.com/prettier@3.9.0/plugins/graphql.js",
"https://unpkg.com/prettier@3.9.1/standalone.js",
"https://unpkg.com/prettier@3.9.1/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.0/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.0/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.0/plugins/estree.mjs";
import * as prettier from "https://unpkg.com/prettier@3.9.1/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.1/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.1/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.0/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.0/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.0/plugins/estree.mjs";
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.9.0/plugins/html.mjs";
import * as prettier from "https://unpkg.com/prettier@3.9.1/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.9.1/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.9.1/plugins/estree.mjs";
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.9.1/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.0
npm install --save-dev --save-exact prettier@3.9.1
```
</TabItem>
<TabItem value="yarn">
```bash
yarn add --dev --exact prettier@3.9.0
yarn add --dev --exact prettier@3.9.1
```
</TabItem>
<TabItem value="pnpm">
```bash
pnpm add --save-dev --save-exact prettier@3.9.0
pnpm add --save-dev --save-exact prettier@3.9.1
```
</TabItem>
<TabItem value="bun">
```bash
bun add --dev --exact prettier@3.9.0
bun add --dev --exact prettier@3.9.1
```
</TabItem>
<TabItem value="deno">
```bash
deno install --dev --save-exact prettier@3.9.0
deno install --dev --save-exact prettier@3.9.1
```
</TabItem>
@@ -46,7 +46,7 @@ Example `package.json`:
"prettier": ">=3.0.0"
},
"devDependencies": {
"prettier": "3.9.0"
"prettier": "3.9.1"
}
}
```
@@ -193,7 +193,7 @@ export default config;
"prettier": ">=3.0.0"
},
"devDependencies": {
"prettier": "3.9.0"
"prettier": "3.9.1"
}
}
```
+31 -31
View File
@@ -484,25 +484,25 @@ __metadata:
languageName: node
linkType: hard
"@cacheable/memory@npm:^2.0.8":
version: 2.0.9
resolution: "@cacheable/memory@npm:2.0.9"
"@cacheable/memory@npm:^2.2.0":
version: 2.2.0
resolution: "@cacheable/memory@npm:2.2.0"
dependencies:
"@cacheable/utils": "npm:^2.4.1"
"@cacheable/utils": "npm:^2.5.0"
"@keyv/bigmap": "npm:^1.3.1"
hookified: "npm:^1.15.1"
keyv: "npm:^5.6.0"
checksum: 10/2e1b159ad59c54599ecd0d313b95950d23f883bc99e363fd9a76b528e96374b6294bd270a94c5930a1081abfda5396939d2db1a6ff49d0e6b5179114d8e45d00
checksum: 10/97db83d7a74979accca9de56cf278e42c22b4273e752d7e23c44fbec4a47450716c4920903424fd19184a7bee6325064b6c453afc6f96bf92b39eecfe0b40648
languageName: node
linkType: hard
"@cacheable/utils@npm:^2.4.1":
version: 2.4.1
resolution: "@cacheable/utils@npm:2.4.1"
"@cacheable/utils@npm:^2.5.0":
version: 2.5.0
resolution: "@cacheable/utils@npm:2.5.0"
dependencies:
hashery: "npm:^1.5.1"
keyv: "npm:^5.6.0"
checksum: 10/5fbea553fd53c8ffe4f3a2e746ce6ecf76f3d90f599b49f2c677c3922e4f643a40f3e90a13727b6e866b7ab3c8e267368d98b54d88d08181050a8d066997cfe7
checksum: 10/a77a7e682926b984cb28b6993f4595638ce8799de3223dbdcdb796a077a02de763687bdc5669779019aba44d27693260ef92d860a19330d7eaa4dfcca3433c3b
languageName: node
linkType: hard
@@ -3341,16 +3341,16 @@ __metadata:
languageName: node
linkType: hard
"cacheable@npm:^2.3.4":
version: 2.3.5
resolution: "cacheable@npm:2.3.5"
"cacheable@npm:^2.5.0":
version: 2.5.0
resolution: "cacheable@npm:2.5.0"
dependencies:
"@cacheable/memory": "npm:^2.0.8"
"@cacheable/utils": "npm:^2.4.1"
"@cacheable/memory": "npm:^2.2.0"
"@cacheable/utils": "npm:^2.5.0"
hookified: "npm:^1.15.0"
keyv: "npm:^5.6.0"
qified: "npm:^0.10.1"
checksum: 10/5d64b477ad1546857efcd8dc3ba62c8bf5acafc7e4e77a0cf93cd96101098e550f69816c55830e74e75f709020ce9e8fc0999552dc06d2f543606efb7a5eb63f
checksum: 10/216a896e17dfa9c598a69e2fff31216126e94286f6c0ceb1bfab1d34e6c1a8791e8dc34dbd28660ec72a84f1d370c3733a9fc481e00a5512fd4e0cfc35775db6
languageName: node
linkType: hard
@@ -4753,12 +4753,12 @@ __metadata:
languageName: node
linkType: hard
"file-entry-cache@npm:11.1.3":
version: 11.1.3
resolution: "file-entry-cache@npm:11.1.3"
"file-entry-cache@npm:11.1.5":
version: 11.1.5
resolution: "file-entry-cache@npm:11.1.5"
dependencies:
flat-cache: "npm:^6.1.22"
checksum: 10/1602c186377488b8b80909c9f6c0ce57744561e84ce38a3df01022906ca6c948c61abe277e180a8619eaa5a30356f0c67fc3a835bc7caa471ff0b19402c13921
flat-cache: "npm:^6.1.23"
checksum: 10/a4a6c45c9561fbceb6511b3483e299e636e5c67e225ea4445c8cbdbe6c571da8505b29b29fc4c62fe9cf28ffe33314f401fad3da09e4b62321c92f0d3a113135
languageName: node
linkType: hard
@@ -4852,14 +4852,14 @@ __metadata:
languageName: node
linkType: hard
"flat-cache@npm:^6.1.22":
version: 6.1.22
resolution: "flat-cache@npm:6.1.22"
"flat-cache@npm:^6.1.23":
version: 6.1.23
resolution: "flat-cache@npm:6.1.23"
dependencies:
cacheable: "npm:^2.3.4"
cacheable: "npm:^2.5.0"
flatted: "npm:^3.4.2"
hookified: "npm:^1.15.0"
checksum: 10/1133b75077c87260324b5b768af742242eacdbcb78e7260e365caef74dd4f31625e95661d25dce8c823b889d657a030f6a8a0b7ef3719223de267cbb1c647143
checksum: 10/63ad3682f399e3e7b7255493b07469f80c418034a10e12e1c7043b41d666ff69b20be924984a0b91cd767a4f71540e4fb4421651d15adc736fca1c04b8505758
languageName: node
linkType: hard
@@ -7905,12 +7905,12 @@ __metadata:
languageName: node
linkType: hard
"prettier@npm:3.9.0":
version: 3.9.0
resolution: "prettier@npm:3.9.0"
"prettier@npm:3.9.1":
version: 3.9.1
resolution: "prettier@npm:3.9.1"
bin:
prettier: bin/prettier.cjs
checksum: 10/146bd970fda6ec01928455b438674581b98ef6d0696146c44d5110176ba104fad023a42d9f41b8b43197684f1ee0cfe7eab5f6777ef914d8cc888575af6fa50d
checksum: 10/1b4317674aa9e90ff79c347fd19f91bb305df98b3122e7131d6815291707781305c45a13cd982474c2f74ed748f2fd0a9aa094f9856609ed1b6f092de8152058
languageName: node
linkType: hard
@@ -7974,7 +7974,7 @@ __metadata:
espree: "npm:11.2.0"
fast-glob: "npm:3.3.3"
fast-json-stable-stringify: "npm:2.1.0"
file-entry-cache: "npm:11.1.3"
file-entry-cache: "npm:11.1.5"
find-cache-directory: "npm:6.0.0"
flow-estree: "npm:0.321.0"
flow-parser: "npm:0.321.0"
@@ -8036,7 +8036,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.0"
prettier: "npm:3.9.1"
pretty-bytes: "npm:7.1.0"
pretty-ms: "npm:9.3.0"
puppeteer: "npm:25.2.1"