Merge branch 'v3.8.x'
This commit is contained in:
commit
afeb915b53
6 files changed
+50
-26
No files matched your search
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
|
||||
|
||||
-->
|
||||
|
||||
**Prettier 3.8.4**
|
||||
**Prettier 3.8.5**
|
||||
[Playground link](https://prettier.io/playground/#.....)
|
||||
|
||||
```sh
|
||||
|
||||
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
|
||||
|
||||
**Environments:**
|
||||
|
||||
- Prettier Version: 3.8.4
|
||||
- Prettier Version: 3.8.5
|
||||
- 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,27 @@
|
||||
# 3.8.5
|
||||
|
||||
[diff](https://github.com/prettier/prettier/compare/3.8.4...3.8.5)
|
||||
|
||||
#### Flow: Support `readonly` as a variance annotation ([#19022](https://github.com/prettier/prettier/pull/19022) by [@marcoww6](https://github.com/marcoww6))
|
||||
|
||||
Flow now accepts `readonly` as a property variance annotation, equivalent to `+` (covariant/read-only).
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
type T = {
|
||||
readonly foo: string,
|
||||
};
|
||||
|
||||
// Prettier 3.8.4
|
||||
SyntaxError
|
||||
|
||||
// Prettier 3.8.5
|
||||
type T = {
|
||||
readonly foo: string,
|
||||
};
|
||||
```
|
||||
|
||||
# 3.8.4
|
||||
|
||||
[diff](https://github.com/prettier/prettier/compare/3.8.3...3.8.4)
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@
|
||||
"node-style-text": "2.1.2",
|
||||
"npm-run-all2": "9.0.2",
|
||||
"open-editor": "6.0.0",
|
||||
"prettier": "3.8.4",
|
||||
"prettier": "3.8.5",
|
||||
"pretty-bytes": "7.1.0",
|
||||
"pretty-ms": "9.3.0",
|
||||
"puppeteer": "25.2.1",
|
||||
|
||||
@@ -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.8.4/plugins](https://unpkg.com/browse/prettier@3.8.4/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.8.5/plugins](https://unpkg.com/browse/prettier@3.8.5/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.8.4/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@3.8.4/plugins/graphql.js"></script>
|
||||
<script src="https://unpkg.com/prettier@3.8.5/standalone.js"></script>
|
||||
<script src="https://unpkg.com/prettier@3.8.5/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.8.4/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.8.4/plugins/graphql.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.8.5/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.8.5/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.8.4/standalone.js",
|
||||
"https://unpkg.com/prettier@3.8.4/plugins/graphql.js",
|
||||
"https://unpkg.com/prettier@3.8.5/standalone.js",
|
||||
"https://unpkg.com/prettier@3.8.5/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.8.4/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.8.41/plugins/graphql.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.8.5/standalone.mjs";
|
||||
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.8.51/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.8.4/standalone.js",
|
||||
"https://unpkg.com/prettier@3.8.4/plugins/graphql.js",
|
||||
"https://unpkg.com/prettier@3.8.5/standalone.js",
|
||||
"https://unpkg.com/prettier@3.8.5/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.8.4/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.8.4/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.8.4/plugins/estree.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.8.5/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.8.5/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.8.5/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.8.4/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.8.4/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.8.4/plugins/estree.mjs";
|
||||
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.8.4/plugins/html.mjs";
|
||||
import * as prettier from "https://unpkg.com/prettier@3.8.5/standalone.mjs";
|
||||
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.8.5/plugins/babel.mjs";
|
||||
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.8.5/plugins/estree.mjs";
|
||||
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.8.5/plugins/html.mjs";
|
||||
|
||||
console.log(
|
||||
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
|
||||
|
||||
@@ -7905,12 +7905,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"prettier@npm:3.8.4":
|
||||
version: 3.8.4
|
||||
resolution: "prettier@npm:3.8.4"
|
||||
"prettier@npm:3.8.5":
|
||||
version: 3.8.5
|
||||
resolution: "prettier@npm:3.8.5"
|
||||
bin:
|
||||
prettier: bin/prettier.cjs
|
||||
checksum: 10/54684a3cc6689238692b29fab541c01934af7677be94c02293ba49981a1ac121c8bebe2a865f0c3b963e99d208f847c53aed354cc0ce8750e2d45791d64506c5
|
||||
checksum: 10/61b59be2f6fdb06850aa8add77a4c3ea31d9536ae25ee9206cdd7a52de968276270a69f4bb71a6e23cbe7bfe6705a74eebdfae2022659c4ccea246e45c290c94
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -8037,7 +8037,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.8.4"
|
||||
prettier: "npm:3.8.5"
|
||||
pretty-bytes: "npm:7.1.0"
|
||||
pretty-ms: "npm:9.3.0"
|
||||
puppeteer: "npm:25.2.1"
|
||||
|
||||
Reference in new issue
Block a user