You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Add `preferUnplugged: true` to `package.json` ([#15169](https://github.com/prettier/prettier/pull/15169) by [@fisker](https://github.com/fisker) and [@so1ve](https://github.com/so1ve))
6
+
7
+
Prettier v3 uses dynamic imports, user [will need to unplug Prettier](https://github.com/yarnpkg/berry/pull/5411#issuecomment-1523502224) when Yarn's PnP mode is enabled, add [`preferUnplugged: true`](https://yarnpkg.com/configuration/manifest#preferUnplugged) to `package.json`, so Yarn will install Prettier as unplug by default.
8
+
9
+
#### Support shared config that forbids `require()` ([#15233](https://github.com/prettier/prettier/pull/15233) by [@fisker](https://github.com/fisker))
10
+
11
+
If an external shared config package is used, and the package `exports` don't have `require` or `default` export.
12
+
13
+
In Prettier 3.0.2 Prettier fails when attempt to `require()` the package, and throws an error.
14
+
15
+
```text
16
+
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in <packageName>/package.json
17
+
```
18
+
19
+
#### Allow argument of `require()` to break ([#15256](https://github.com/prettier/prettier/pull/15256) by [@fisker](https://github.com/fisker))
20
+
21
+
<!-- prettier-ignore -->
22
+
```jsx
23
+
// Input
24
+
const plugin = require(
25
+
global.STANDALONE
26
+
? path.join(__dirname, "../standalone.js")
27
+
: path.join(__dirname, "..")
28
+
);
29
+
30
+
// Prettier 3.0.2
31
+
const plugin = require(global.STANDALONE
32
+
? path.join(__dirname, "../standalone.js")
33
+
: path.join(__dirname, ".."));
34
+
35
+
// Prettier 3.0.3
36
+
const plugin = require(
37
+
global.STANDALONE
38
+
? path.join(__dirname, "../standalone.js")
39
+
: path.join(__dirname, "..")
40
+
);
41
+
```
42
+
43
+
#### Do not print trailing commas in arrow function type parameter lists in `ts` code blocks ([#15286](https://github.com/prettier/prettier/pull/15286) by [@sosukesuzuki](https://github.com/sosukesuzuki))
44
+
45
+
<!-- prettier-ignore -->
46
+
````md
47
+
<!-- Input -->
48
+
```ts
49
+
const foo = <T>() => {}
50
+
```
51
+
52
+
<!-- Prettier 3.0.2 -->
53
+
```ts
54
+
const foo = <T,>() => {}
55
+
```
56
+
57
+
<!-- Prettier 3.0.3 -->
58
+
```ts
59
+
const foo = <T>() => {}
60
+
```
61
+
````
62
+
63
+
#### Support TypeScript 5.2 `using` / `await using` declaration ([#15321](https://github.com/prettier/prettier/pull/15321) by [@sosukesuzuki](https://github.com/sosukesuzuki))
64
+
65
+
Support for the upcoming Explicit Resource Management feature in ECMAScript. [`using` / `await using` declaration](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management)
Copy file name to clipboardExpand all lines: docs/browser.md
+16-16
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Required options:
18
18
19
19
-**[`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.
20
20
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/[email protected].2/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/[email protected].3/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
22
22
23
23
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
Copy file name to clipboardExpand all lines: website/versioned_docs/version-stable/browser.md
+16-16
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Required options:
19
19
20
20
-**[`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.
21
21
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/[email protected].2/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/[email protected].3/plugins/>. Note that `estree` plugin should be loaded when printing JavaScript, TypeScript, Flow, or JSON.
23
23
24
24
You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option.
0 commit comments