Skip to content

Commit c4ab460

Browse files
committed
Release 3.3.0
1 parent 8a88cdc commit c4ab460

11 files changed

Lines changed: 60 additions & 63 deletions

File tree

.github/ISSUE_TEMPLATE/formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Don't fill the form below manually! Let a program create a report for you:
2626
2727
-->
2828

29-
**Prettier 3.2.5**
29+
**Prettier 3.3.0**
3030
[Playground link](https://prettier.io/playground/#.....)
3131

3232
```sh

.github/ISSUE_TEMPLATE/integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BEFORE SUBMITTING AN ISSUE:
2020

2121
**Environments:**
2222

23-
- Prettier Version: 3.2.5
23+
- Prettier Version: 3.3.0
2424
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
2525
- Runtime: <!-- Node.js v14, Chrome v83, etc. -->
2626
- Operating System: <!-- Windows, Linux, macOS, etc. -->

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 3.3.0
2+
3+
[diff](https://github.com/prettier/prettier/compare/3.2.5...3.3.0)
4+
5+
🔗 [Release Notes](https://prettier.io/blog/2024/06/01/3.3.0.html)
6+
17
# 3.2.5
28

39
[diff](https://github.com/prettier/prettier/compare/3.2.4...3.2.5)

docs/browser.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Required options:
1818

1919
- **[`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.
2020

21-
- **`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.2.5/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
21+
- **`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.3.0/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
2222

2323
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
2424

@@ -29,8 +29,8 @@ See below for examples.
2929
### Global
3030

3131
```html
32-
<script src="https://unpkg.com/prettier@3.2.5/standalone.js"></script>
33-
<script src="https://unpkg.com/prettier@3.2.5/plugins/graphql.js"></script>
32+
<script src="https://unpkg.com/prettier@3.3.0/standalone.js"></script>
33+
<script src="https://unpkg.com/prettier@3.3.0/plugins/graphql.js"></script>
3434
<script>
3535
(async () => {
3636
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
4747

4848
```html
4949
<script type="module">
50-
import * as prettier from "https://unpkg.com/prettier@3.2.5/standalone.mjs";
51-
import prettierPluginGraphql from "https://unpkg.com/prettier@3.2.5/plugins/graphql.mjs";
50+
import * as prettier from "https://unpkg.com/prettier@3.3.0/standalone.mjs";
51+
import prettierPluginGraphql from "https://unpkg.com/prettier@3.3.0/plugins/graphql.mjs";
5252
5353
const formatted = await prettier.format("type Query { hello: String }", {
5454
parser: "graphql",
@@ -61,8 +61,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
6161

6262
```js
6363
define([
64-
"https://unpkg.com/prettier@3.2.5/standalone.js",
65-
"https://unpkg.com/prettier@3.2.5/plugins/graphql.js",
64+
"https://unpkg.com/prettier@3.3.0/standalone.js",
65+
"https://unpkg.com/prettier@3.3.0/plugins/graphql.js",
6666
], async (prettier, ...plugins) => {
6767
const formatted = await prettier.format("type Query { hello: String }", {
6868
parser: "graphql",
@@ -90,8 +90,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
9090
### Worker
9191

9292
```js
93-
importScripts("https://unpkg.com/prettier@3.2.5/standalone.js");
94-
importScripts("https://unpkg.com/prettier@3.2.5/plugins/graphql.js");
93+
importScripts("https://unpkg.com/prettier@3.3.0/standalone.js");
94+
importScripts("https://unpkg.com/prettier@3.3.0/plugins/graphql.js");
9595

9696
(async () => {
9797
const formatted = await prettier.format("type Query { hello: String }", {
@@ -107,9 +107,9 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
107107

108108
```html
109109
<script type="module">
110-
import * as prettier from "https://unpkg.com/prettier@3.2.5/standalone.mjs";
111-
import prettierPluginBabel from "https://unpkg.com/prettier@3.2.5/plugins/babel.mjs";
112-
import prettierPluginEstree from "https://unpkg.com/prettier@3.2.5/plugins/estree.mjs";
110+
import * as prettier from "https://unpkg.com/prettier@3.3.0/standalone.mjs";
111+
import prettierPluginBabel from "https://unpkg.com/prettier@3.3.0/plugins/babel.mjs";
112+
import prettierPluginEstree from "https://unpkg.com/prettier@3.3.0/plugins/estree.mjs";
113113
114114
console.log(
115115
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -125,10 +125,10 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
125125

126126
```html
127127
<script type="module">
128-
import * as prettier from "https://unpkg.com/prettier@3.2.5/standalone.mjs";
129-
import prettierPluginBabel from "https://unpkg.com/prettier@3.2.5/plugins/babel.mjs";
130-
import prettierPluginEstree from "https://unpkg.com/prettier@3.2.5/plugins/estree.mjs";
131-
import prettierPluginHtml from "https://unpkg.com/prettier@3.2.5/plugins/html.mjs";
128+
import * as prettier from "https://unpkg.com/prettier@3.3.0/standalone.mjs";
129+
import prettierPluginBabel from "https://unpkg.com/prettier@3.3.0/plugins/babel.mjs";
130+
import prettierPluginEstree from "https://unpkg.com/prettier@3.3.0/plugins/estree.mjs";
131+
import prettierPluginHtml from "https://unpkg.com/prettier@3.3.0/plugins/html.mjs";
132132
133133
console.log(
134134
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "3.3.0-dev",
3+
"version": "3.3.0",
44
"description": "Prettier is an opinionated code formatter",
55
"bin": "./bin/prettier.cjs",
66
"repository": "prettier/prettier",

website/versioned_docs/version-stable/browser.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Required options:
1919

2020
- **[`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.
2121

22-
- **`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.2.5/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
22+
- **`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.3.0/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
2323

2424
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
2525

@@ -30,8 +30,8 @@ See below for examples.
3030
### Global
3131

3232
```html
33-
<script src="https://unpkg.com/prettier@3.2.5/standalone.js"></script>
34-
<script src="https://unpkg.com/prettier@3.2.5/plugins/graphql.js"></script>
33+
<script src="https://unpkg.com/prettier@3.3.0/standalone.js"></script>
34+
<script src="https://unpkg.com/prettier@3.3.0/plugins/graphql.js"></script>
3535
<script>
3636
(async () => {
3737
const formatted = await prettier.format("type Query { hello: String }", {
@@ -48,8 +48,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
4848

4949
```html
5050
<script type="module">
51-
import * as prettier from "https://unpkg.com/prettier@3.2.5/standalone.mjs";
52-
import prettierPluginGraphql from "https://unpkg.com/prettier@3.2.5/plugins/graphql.mjs";
51+
import * as prettier from "https://unpkg.com/prettier@3.3.0/standalone.mjs";
52+
import prettierPluginGraphql from "https://unpkg.com/prettier@3.3.0/plugins/graphql.mjs";
5353
5454
const formatted = await prettier.format("type Query { hello: String }", {
5555
parser: "graphql",
@@ -62,8 +62,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
6262

6363
```js
6464
define([
65-
"https://unpkg.com/prettier@3.2.5/standalone.js",
66-
"https://unpkg.com/prettier@3.2.5/plugins/graphql.js",
65+
"https://unpkg.com/prettier@3.3.0/standalone.js",
66+
"https://unpkg.com/prettier@3.3.0/plugins/graphql.js",
6767
], async (prettier, ...plugins) => {
6868
const formatted = await prettier.format("type Query { hello: String }", {
6969
parser: "graphql",
@@ -91,8 +91,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
9191
### Worker
9292

9393
```js
94-
importScripts("https://unpkg.com/prettier@3.2.5/standalone.js");
95-
importScripts("https://unpkg.com/prettier@3.2.5/plugins/graphql.js");
94+
importScripts("https://unpkg.com/prettier@3.3.0/standalone.js");
95+
importScripts("https://unpkg.com/prettier@3.3.0/plugins/graphql.js");
9696

9797
(async () => {
9898
const formatted = await prettier.format("type Query { hello: String }", {
@@ -108,9 +108,9 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
108108

109109
```html
110110
<script type="module">
111-
import * as prettier from "https://unpkg.com/prettier@3.2.5/standalone.mjs";
112-
import prettierPluginBabel from "https://unpkg.com/prettier@3.2.5/plugins/babel.mjs";
113-
import prettierPluginEstree from "https://unpkg.com/prettier@3.2.5/plugins/estree.mjs";
111+
import * as prettier from "https://unpkg.com/prettier@3.3.0/standalone.mjs";
112+
import prettierPluginBabel from "https://unpkg.com/prettier@3.3.0/plugins/babel.mjs";
113+
import prettierPluginEstree from "https://unpkg.com/prettier@3.3.0/plugins/estree.mjs";
114114
115115
console.log(
116116
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -126,10 +126,10 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
126126

127127
```html
128128
<script type="module">
129-
import * as prettier from "https://unpkg.com/prettier@3.2.5/standalone.mjs";
130-
import prettierPluginBabel from "https://unpkg.com/prettier@3.2.5/plugins/babel.mjs";
131-
import prettierPluginEstree from "https://unpkg.com/prettier@3.2.5/plugins/estree.mjs";
132-
import prettierPluginHtml from "https://unpkg.com/prettier@3.2.5/plugins/html.mjs";
129+
import * as prettier from "https://unpkg.com/prettier@3.3.0/standalone.mjs";
130+
import prettierPluginBabel from "https://unpkg.com/prettier@3.3.0/plugins/babel.mjs";
131+
import prettierPluginEstree from "https://unpkg.com/prettier@3.3.0/plugins/estree.mjs";
132+
import prettierPluginHtml from "https://unpkg.com/prettier@3.3.0/plugins/html.mjs";
133133
134134
console.log(
135135
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

website/versioned_docs/version-stable/configuration.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ original_id: configuration
66

77
You can configure Prettier via (in order of precedence):
88

9-
- A `"prettier"` key in your `package.json` file.
9+
- A `"prettier"` key in your `package.json`, or [`package.yaml`](https://github.com/pnpm/pnpm/pull/1799) file.
1010
- A `.prettierrc` file written in JSON or YAML.
1111
- A `.prettierrc.json`, `.prettierrc.yml`, `.prettierrc.yaml`, or `.prettierrc.json5` file.
1212
- A `.prettierrc.js`, or `prettier.config.js` file that exports an object using `export default` or `module.exports` (depends on the [`type`](https://nodejs.org/api/packages.html#type) value in your `package.json`).
@@ -33,12 +33,15 @@ JSON:
3333
}
3434
```
3535

36-
JS(ESM):
36+
JS (ES Modules):
3737

3838
```js
3939
// prettier.config.js, .prettierrc.js, prettier.config.mjs, or .prettierrc.mjs
4040

41-
/** @type {import("prettier").Config} */
41+
/**
42+
* @see https://prettier.io/docs/en/configuration.html
43+
* @type {import("prettier").Config}
44+
*/
4245
const config = {
4346
trailingComma: "es5",
4447
tabWidth: 4,
@@ -49,12 +52,15 @@ const config = {
4952
export default config;
5053
```
5154

52-
JS(CommonJS):
55+
JS (CommonJS):
5356

5457
```js
5558
// prettier.config.js, .prettierrc.js, prettier.config.cjs, or .prettierrc.cjs
5659

57-
/** @type {import("prettier").Config} */
60+
/**
61+
* @see https://prettier.io/docs/en/configuration.html
62+
* @type {import("prettier").Config}
63+
*/
5864
const config = {
5965
trailingComma: "es5",
6066
tabWidth: 4,

website/versioned_docs/version-stable/editors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For more details see [the Vim setup guide](vim.md).
3030

3131
A formatter can be specified in your [Helix language configuration](https://docs.helix-editor.com/languages.html#language-configuration), which will take precedence over any language servers.
3232

33-
For more details see the [Helix external binary formatter configuration for Prettier](https://github.com/helix-editor/helix/wiki/External-binary-formatter-configuration#prettier).
33+
For more details see the [Helix external binary formatter configuration for Prettier](https://github.com/helix-editor/helix/wiki/External-formatter-configuration#prettier).
3434

3535
## Sublime Text
3636

website/versioned_docs/version-stable/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ For example, you can do the following to have Prettier run before each commit:
163163
```bash
164164
bun add --dev husky lint-staged
165165
bunx husky init
166-
bun --eval "fs.writeFileSync('.husky/pre-commit','pnpm exec lint-staged\n')"
166+
bun --eval "fs.writeFileSync('.husky/pre-commit','bunx lint-staged\n')"
167167
```
168168

169169
<!--END_DOCUSAURUS_CODE_TABS-->

website/versioned_docs/version-stable/plugins.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function print(
203203

204204
The `print` function is passed the following parameters:
205205

206-
- **`path`**: An object, which can be used to access nodes in the AST. It’s a stack-like data structure that maintains the current state of the recursion. It is called “path” because it represents the path to the current node from the root of the AST. The current node is returned by `path.getValue()`.
206+
- **`path`**: An object, which can be used to access nodes in the AST. It’s a stack-like data structure that maintains the current state of the recursion. It is called “path” because it represents the path to the current node from the root of the AST. The current node is returned by `path.node`.
207207
- **`options`**: A persistent object, which contains global options and which a plugin may mutate to store contextual data.
208208
- **`print`**: A callback for printing sub-nodes. This function contains the core printing logic that consists of steps whose implementation is provided by plugins. In particular, it calls the printer’s `print` function and passes itself to it. Thus, the two `print` functions – the one from the core and the one from the plugin – call each other while descending down the AST recursively.
209209

@@ -215,7 +215,7 @@ import { doc } from "prettier";
215215
const { group, indent, join, line, softline } = doc.builders;
216216

217217
function print(path, options, print) {
218-
const node = path.getValue();
218+
const node = path.node;
219219

220220
switch (node.type) {
221221
case "list":
@@ -282,7 +282,7 @@ For example, a plugin that has nodes with embedded JavaScript might have the fol
282282

283283
```js
284284
function embed(path, options) {
285-
const node = path.getValue();
285+
const node = path.node;
286286
if (node.type === "javascript") {
287287
return async (textToDoc) => {
288288
return [

0 commit comments

Comments
 (0)