Skip to content

Commit e1c8095

Browse files
committed
Release 3.6.0
1 parent 9dfcdcb commit e1c8095

File tree

8 files changed

+73
-23
lines changed

8 files changed

+73
-23
lines changed

.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.5.3**
29+
**Prettier 3.6.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.5.3
23+
- Prettier Version: 3.6.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.6.0
2+
3+
[diff](https://github.com/prettier/prettier/compare/3.5.3...3.6.0)
4+
5+
🔗 [Release Notes](https://prettier.io/blog/2025/06/23/3.6.0)
6+
17
# 3.5.3
28

39
[diff](https://github.com/prettier/prettier/compare/3.5.2...3.5.3)

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.6.0-dev",
3+
"version": "3.6.0",
44
"description": "Prettier is an opinionated code formatter",
55
"bin": "./bin/prettier.cjs",
66
"repository": "prettier/prettier",

website/versioned_docs/version-stable/api.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Setting `options.ignorePath` (`string | URL | (string | URL)[]`) and `options.wi
9999

100100
If the given `fileUrlOrPath` is ignored, the `inferredParser` is always `null`.
101101

102-
Providing [plugin](plugins.md) paths in `options.plugins` (`string[]`) helps extract `inferredParser` for files that are not supported by Prettier core.
102+
Providing [plugin](plugins.md) paths in `options.plugins` (`(string | URL | Plugin)[]`) helps extract `inferredParser` for files that are not supported by Prettier core.
103103

104104
When setting `options.resolveConfig` (`boolean`, default `true`) to `false`, Prettier will not search for configuration file. This can be useful if this function is only used to check if file is ignored.
105105

@@ -124,10 +124,18 @@ The support information looks like this:
124124
filenames?: string[];
125125
linguistLanguageId?: number;
126126
vscodeLanguageIds?: string[];
127+
isSupported?(options: { filepath: string }): boolean;
127128
}>;
128129
}
129130
```
130131

132+
:::note
133+
134+
Prettier can not ensure that `filepath` exists on disk.\
135+
When using from APIs(eg: `prettier.format()`), Prettier can not ensure it's a valid path either.
136+
137+
:::
138+
131139
<a name="custom-parser-api"></a>
132140

133141
## Custom Parser API (removed)

website/versioned_docs/version-stable/browser.md

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

2222
- **[`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.
2323

24-
- **`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.
24+
- **`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.6.0/plugins](https://unpkg.com/browse/prettier@3.6.0/plugins). Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
2525

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

@@ -32,8 +32,8 @@ See below for examples.
3232
### Global
3333

3434
```html
35-
<script src="https://unpkg.com/prettier@3.5.3/standalone.js"></script>
36-
<script src="https://unpkg.com/prettier@3.5.3/plugins/graphql.js"></script>
35+
<script src="https://unpkg.com/prettier@3.6.0/standalone.js"></script>
36+
<script src="https://unpkg.com/prettier@3.6.0/plugins/graphql.js"></script>
3737
<script>
3838
(async () => {
3939
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
5050

5151
```html
5252
<script type="module">
53-
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
54-
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.5.3/plugins/graphql.mjs";
53+
import * as prettier from "https://unpkg.com/prettier@3.6.0/standalone.mjs";
54+
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.6.0/plugins/graphql.mjs";
5555
5656
const formatted = await prettier.format("type Query { hello: String }", {
5757
parser: "graphql",
@@ -64,8 +64,8 @@ Note that the [`unpkg` field](https://unpkg.com/#examples) in Prettier’s `pack
6464

6565
```js
6666
define([
67-
"https://unpkg.com/prettier@3.5.3/standalone.js",
68-
"https://unpkg.com/prettier@3.5.3/plugins/graphql.js",
67+
"https://unpkg.com/prettier@3.6.0/standalone.js",
68+
"https://unpkg.com/prettier@3.6.0/plugins/graphql.js",
6969
], async (prettier, ...plugins) => {
7070
const formatted = await prettier.format("type Query { hello: String }", {
7171
parser: "graphql",
@@ -96,8 +96,8 @@ This syntax doesn’t necessarily work in the browser, but it can be used when b
9696
<TabItem value="module" label="Module worker">
9797

9898
```js
99-
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
100-
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.5.31/plugins/graphql.mjs";
99+
import * as prettier from "https://unpkg.com/prettier@3.6.0/standalone.mjs";
100+
import * as prettierPluginGraphql from "https://unpkg.com/prettier@3.6.01/plugins/graphql.mjs";
101101

102102
const formatted = await prettier.format("type Query { hello: String }", {
103103
parser: "graphql",
@@ -110,8 +110,8 @@ const formatted = await prettier.format("type Query { hello: String }", {
110110

111111
```js
112112
importScripts(
113-
"https://unpkg.com/prettier@3.5.3/standalone.js",
114-
"https://unpkg.com/prettier@3.5.3/plugins/graphql.js",
113+
"https://unpkg.com/prettier@3.6.0/standalone.js",
114+
"https://unpkg.com/prettier@3.6.0/plugins/graphql.js",
115115
);
116116

117117
(async () => {
@@ -131,9 +131,9 @@ If you want to format [embedded code](options.md#embedded-language-formatting),
131131

132132
```html
133133
<script type="module">
134-
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
135-
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.5.3/plugins/babel.mjs";
136-
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.5.3/plugins/estree.mjs";
134+
import * as prettier from "https://unpkg.com/prettier@3.6.0/standalone.mjs";
135+
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.6.0/plugins/babel.mjs";
136+
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.6.0/plugins/estree.mjs";
137137
138138
console.log(
139139
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {
@@ -149,10 +149,10 @@ The HTML code embedded in JavaScript stays unformatted because the `html` parser
149149

150150
```html
151151
<script type="module">
152-
import * as prettier from "https://unpkg.com/prettier@3.5.3/standalone.mjs";
153-
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.5.3/plugins/babel.mjs";
154-
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.5.3/plugins/estree.mjs";
155-
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.5.3/plugins/html.mjs";
152+
import * as prettier from "https://unpkg.com/prettier@3.6.0/standalone.mjs";
153+
import * as prettierPluginBabel from "https://unpkg.com/prettier@3.6.0/plugins/babel.mjs";
154+
import * as prettierPluginEstree from "https://unpkg.com/prettier@3.6.0/plugins/estree.mjs";
155+
import * as prettierPluginHtml from "https://unpkg.com/prettier@3.6.0/plugins/html.mjs";
156156
157157
console.log(
158158
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

website/versioned_docs/version-stable/options.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ Valid options:
325325
- `"vue"` (same parser as `"html"`, but also formats vue-specific syntax) _First available in 1.10.0_
326326
- `"angular"` (same parser as `"html"`, but also formats angular-specific syntax via [angular-estree-parser](https://github.com/ikatyang/angular-estree-parser)) _First available in 1.15.0_
327327
- `"lwc"` (same parser as `"html"`, but also formats LWC-specific syntax for unquoted template attributes) _First available in 1.17.0_
328+
- `"mjml"` (same parser as `"html"`, but also formats MJML-specific syntax) _First available in 3.6.0_
328329
- `"yaml"` (via [yaml](https://github.com/eemeli/yaml) and [yaml-unist-parser](https://github.com/ikatyang/yaml-unist-parser)) _First available in 1.14.0_
329330

330331
| Default | CLI Override | API Override |
@@ -393,6 +394,34 @@ Note that “in tandem” doesn’t mean “at the same time”. When the two op
393394

394395
[adoption strategy]: https://prettier.io/blog/2017/05/03/1.3.0.html#facebook-adoption-update
395396

397+
## Check Ignore Pragma
398+
399+
_First available in v3.6.0_
400+
401+
Prettier can allow individual files to opt out of formatting if they contain a special comment, called a pragma, at the top of the file.
402+
403+
Checking for these markers incurs a small upfront cost during formatting, so it's not enabled by default.
404+
405+
A file with the following as its first comment will **not** be formatted when `--check-ignore-pragma` is supplied:
406+
407+
```js
408+
/**
409+
* @noprettier
410+
*/
411+
```
412+
413+
or
414+
415+
```js
416+
/**
417+
* @noformat
418+
*/
419+
```
420+
421+
| Default | CLI Override | API Override |
422+
| ------- | ----------------------- | --------------------------- |
423+
| `false` | `--check-ignore-pragma` | `checkIgnorePragma: <bool>` |
424+
396425
## Prose Wrap
397426

398427
_First available in v1.8.2_

website/versioned_docs/version-stable/plugins.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Strings provided to `plugins` are ultimately passed to [`import()` expression](h
7070
- [`prettier-plugin-sql-cst`](https://github.com/nene/prettier-plugin-sql-cst) by [**@nene**](https://github.com/nene)
7171
- [`prettier-plugin-solidity`](https://github.com/prettier-solidity/prettier-plugin-solidity) by [**@mattiaerre**](https://github.com/mattiaerre)
7272
- [`prettier-plugin-svelte`](https://github.com/sveltejs/prettier-plugin-svelte) by [**@sveltejs**](https://github.com/sveltejs)
73-
- [`prettier-plugin-toml`](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml) by [**@bd82**](https://github.com/bd82)
73+
- [`prettier-plugin-toml`](https://github.com/un-ts/prettier/tree/master/packages/toml) by [**@JounQin**](https://github.com/JounQin) and [**@so1ve**](https://github.com/so1ve)
7474

7575
## Developing Plugins
7676

@@ -113,6 +113,7 @@ export const parsers = {
113113
// The name of the AST that the parser produces.
114114
astFormat: "dance-ast",
115115
hasPragma,
116+
hasIgnorePragma,
116117
locStart,
117118
locEnd,
118119
preprocess,
@@ -138,6 +139,12 @@ _(Optional)_ The pragma detection function (`hasPragma`) should return if the te
138139
function hasPragma(text: string): boolean;
139140
```
140141

142+
_(Optional)_ The "ignore pragma" detection function (`hasIgnorePragma`) should return if the text contains a pragma indicating the text should not be formatted.
143+
144+
```ts
145+
function hasIgnorePragma(text: string): boolean;
146+
```
147+
141148
_(Optional)_ The preprocess function can process the input text before passing into `parse` function.
142149

143150
```ts

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy