Merge branch 'patch'

This commit is contained in:
fisker committed 2025-03-03 09:22:42 +08:00
commit b3b17ff5d0
7 files changed
+49 -28

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.5.2**
**Prettier 3.5.3**
[Playground link](https://prettier.io/playground/#.....)
```sh
+1 -1
View File
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
**Environments:**
- Prettier Version: 3.5.2
- Prettier Version: 3.5.3
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
+21
View File
@@ -1,3 +1,24 @@
# 3.5.3
[diff](https://github.com/prettier/prettier/compare/3.5.2...3.5.3)
#### Flow: Fix missing parentheses in `ConditionalTypeAnnotation` ([#17196](https://github.com/prettier/prettier/pull/17196) by [@fisker](https://github.com/fisker))
<!-- prettier-ignore -->
```jsx
// Input
type T<U> = 'a' | ('b' extends U ? 'c' : empty);
type T<U> = 'a' & ('b' extends U ? 'c' : empty);
// Prettier 3.5.2
type T<U> = "a" | "b" extends U ? "c" : empty;
type T<U> = "a" & "b" extends U ? "c" : empty;
// Prettier 3.5.3
type T<U> = "a" | ("b" extends U ? "c" : empty);
type T<U> = "a" & ("b" extends U ? "c" : empty);
```
# 3.5.2
[diff](https://github.com/prettier/prettier/compare/3.5.1...3.5.2)
+1 -1
View File
@@ -142,7 +142,7 @@
"nano-spawn": "0.2.0",
"node-style-text": "0.0.7",
"npm-run-all2": "7.0.2",
"prettier": "3.5.2",
"prettier": "3.5.3",
"pretty-bytes": "6.1.1",
"rollup-plugin-license": "3.6.0",
"semver": "7.7.1",
+2 -2
View File
@@ -316,7 +316,7 @@ function UsersSection() {
<div>
<p>
More than{" "}
<strong data-placeholder="dependent-github">9.2 million</strong>{" "}
<strong data-placeholder="dependent-github">9.3 million</strong>{" "}
dependent repositories on GitHub
</p>
<Link
@@ -338,7 +338,7 @@ function UsersSection() {
<div>
<p>
More than{" "}
<strong data-placeholder="dependent-npm">19.2k</strong>{" "}
<strong data-placeholder="dependent-npm">19.3k</strong>{" "}
dependent packages on npm
</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.5.2/plugins](https://unpkg.com/browse/prettier@3.5.2/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.5.3/plugins](https://unpkg.com/browse/prettier@3.5.3/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.5.2/standalone.js"></script>
<script src="https://unpkg.com/prettier@3.5.2/plugins/graphql.js"></script>
<script src="https://unpkg.com/prettier@3.5.3/standalone.js"></script>
<script src="https://unpkg.com/prettier@3.5.3/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.5.2/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.5.2/plugins/graphql.mjs";
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.5.3/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.5.2/standalone.js",
"https://unpkg.com/prettier@3.5.2/plugins/graphql.js",
"https://unpkg.com/prettier@3.5.3/standalone.js",
"https://unpkg.com/prettier@3.5.3/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.5.2/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.5.21/plugins/graphql.mjs";
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.5.31/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.5.2/standalone.js",
"https://unpkg.com/prettier@3.5.2/plugins/graphql.js",
"https://unpkg.com/prettier@3.5.3/standalone.js",
"https://unpkg.com/prettier@3.5.3/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.5.2/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.5.2/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.5.2/plugins/estree.mjs";
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.5.3/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.5.3/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.5.2/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.5.2/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.5.2/plugins/estree.mjs";
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.5.2/plugins/html.mjs";
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.5.3/plugins/babel.mjs";
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.5.3/plugins/estree.mjs";
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.5.3/plugins/html.mjs";
console.log(
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
+5 -5
View File
@@ -6854,12 +6854,12 @@ __metadata:
languageName: node
linkType: hard
"prettier@npm:3.5.2":
version: 3.5.2
resolution: "prettier@npm:3.5.2"
"prettier@npm:3.5.3":
version: 3.5.3
resolution: "prettier@npm:3.5.3"
bin:
prettier: bin/prettier.cjs
checksum: 10/ac7a157c8ec76459b13d81a03ff65d228015992cb926b676b0f1c83edd47e5db8ba257336b400be20942fc671816f1afde377cffe94d9e4368762a3d3acbffe5
checksum: 10/7050c08f674d9e49fbd9a4c008291d0715471f64e94cc5e4b01729affce221dfc6875c8de7e66b728c64abc9352eefb7eaae071b5f79d30081be207b53774b78
languageName: node
linkType: hard
@@ -6962,7 +6962,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.5.2"
prettier: "npm:3.5.3"
pretty-bytes: "npm:6.1.1"
regexp-util: "npm:2.0.0"
remark-footnotes: "npm:2.0.0"