Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cca9461

Browse files
committed
Release 3.4.2
1 parent 572bebe commit cca9461

File tree

5 files changed

+126
-19
lines changed

5 files changed

+126
-19
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.4.1**
29+
**Prettier 3.4.2**
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.4.1
23+
- Prettier Version: 3.4.2
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: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,110 @@
1+
# 3.4.2
2+
3+
[diff](https://github.com/prettier/prettier/compare/3.4.1...3.4.2)
4+
5+
#### Treat U+30A0 & U+30FB in Katakana Block as CJK ([#16796](https://github.com/prettier/prettier/pull/16796) by [@tats-u](https://github.com/tats-u))
6+
7+
Prettier doesn't treat U+30A0 & U+30FB as Japanese. U+30FB is commonly used in Japanese to represent the delimitation of first and last names of non-Japanese people or “and”. The following “C言語・C++・Go・Rust” means “C language & C++ & Go & Rust” in Japanese.
8+
9+
<!-- prettier-ignore -->
10+
```md
11+
<!-- Input (--prose-wrap=never) -->
12+
13+
C言
14+
15+
16+
C++
17+
18+
Go
19+
20+
Rust
21+
22+
<!-- Prettier 3.4.1 -->
23+
C言語・ C++ ・ Go ・ Rust
24+
25+
<!-- Prettier 3.4.2 -->
26+
C言語・C++・Go・Rust
27+
```
28+
29+
U+30A0 can be used as the replacement of the `-` in non-Japanese names (e.g. “Saint-Saëns” (Charles Camille Saint-Saëns) can be represented as “サン゠サーンス” in Japanese), but substituted by ASCII hyphen (U+002D) or U+FF1D (full width hyphen) in many cases (e.g. “サン=サーンス” or “サン=サーンス”).
30+
31+
#### Fix comments print on class methods with decorators ([#16891](https://github.com/prettier/prettier/pull/16891) by [@fisker](https://github.com/fisker))
32+
33+
<!-- prettier-ignore -->
34+
```jsx
35+
// Input
36+
class A {
37+
@decorator
38+
/**
39+
* The method description
40+
*
41+
*/
42+
async method(foo: Foo, bar: Bar) {
43+
console.log(foo);
44+
}
45+
}
46+
47+
// Prettier 3.4.1
48+
class A {
49+
@decorator
50+
async /**
51+
* The method description
52+
*
53+
*/
54+
method(foo: Foo, bar: Bar) {
55+
console.log(foo);
56+
}
57+
}
58+
59+
// Prettier 3.4.2
60+
class A {
61+
@decorator
62+
/**
63+
* The method description
64+
*
65+
*/
66+
async method(foo: Foo, bar: Bar) {
67+
console.log(foo);
68+
}
69+
}
70+
```
71+
72+
#### Fix non-idempotent formatting ([#16899](https://github.com/prettier/prettier/pull/16899) by [@seiyab](https://github.com/seiyab))
73+
74+
This bug fix is not language-specific. You may see similar change in any languages. This fixes regression in 3.4.0 so change caused by it should yield same formatting as 3.3.3.
75+
76+
<!-- prettier-ignore -->
77+
```jsx
78+
// Input
79+
<div>
80+
foo
81+
<span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>
82+
, abc
83+
</div>;
84+
85+
// Prettier 3.4.1 (first)
86+
<div>
87+
foo
88+
<span>
89+
longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo
90+
</span>, abc
91+
</div>;
92+
93+
// Prettier 3.4.1 (second)
94+
<div>
95+
foo
96+
<span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>
97+
, abc
98+
</div>;
99+
100+
// Prettier 3.4.2
101+
<div>
102+
foo
103+
<span>longlonglonglonglonglonglonglonglonglonglonglonglonglonglongl foo</span>
104+
, abc
105+
</div>;
106+
```
107+
1108
# 3.4.1
2109

3110
[diff](https://github.com/prettier/prettier/compare/3.4.0...3.4.1)

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.5.0-dev",
3+
"version": "3.4.2",
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/[email protected].1/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].2/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/[email protected].1/standalone.js"></script>
34-
<script src="https://unpkg.com/[email protected].1/plugins/graphql.js"></script>
33+
<script src="https://unpkg.com/[email protected].2/standalone.js"></script>
34+
<script src="https://unpkg.com/[email protected].2/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/[email protected].1/standalone.mjs";
52-
import prettierPluginGraphql from "https://unpkg.com/[email protected].1/plugins/graphql.mjs";
51+
import * as prettier from "https://unpkg.com/[email protected].2/standalone.mjs";
52+
import prettierPluginGraphql from "https://unpkg.com/[email protected].2/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/[email protected].1/standalone.js",
66-
"https://unpkg.com/[email protected].1/plugins/graphql.js",
65+
"https://unpkg.com/[email protected].2/standalone.js",
66+
"https://unpkg.com/[email protected].2/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/[email protected].1/standalone.js");
95-
importScripts("https://unpkg.com/[email protected].1/plugins/graphql.js");
94+
importScripts("https://unpkg.com/[email protected].2/standalone.js");
95+
importScripts("https://unpkg.com/[email protected].2/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/[email protected].1/standalone.mjs";
112-
import prettierPluginBabel from "https://unpkg.com/[email protected].1/plugins/babel.mjs";
113-
import prettierPluginEstree from "https://unpkg.com/[email protected].1/plugins/estree.mjs";
111+
import * as prettier from "https://unpkg.com/[email protected].2/standalone.mjs";
112+
import prettierPluginBabel from "https://unpkg.com/[email protected].2/plugins/babel.mjs";
113+
import prettierPluginEstree from "https://unpkg.com/[email protected].2/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/[email protected].1/standalone.mjs";
130-
import prettierPluginBabel from "https://unpkg.com/[email protected].1/plugins/babel.mjs";
131-
import prettierPluginEstree from "https://unpkg.com/[email protected].1/plugins/estree.mjs";
132-
import prettierPluginHtml from "https://unpkg.com/[email protected].1/plugins/html.mjs";
129+
import * as prettier from "https://unpkg.com/[email protected].2/standalone.mjs";
130+
import prettierPluginBabel from "https://unpkg.com/[email protected].2/plugins/babel.mjs";
131+
import prettierPluginEstree from "https://unpkg.com/[email protected].2/plugins/estree.mjs";
132+
import prettierPluginHtml from "https://unpkg.com/[email protected].2/plugins/html.mjs";
133133
134134
console.log(
135135
await prettier.format("const html=/* HTML */ `<DIV> </DIV>`", {

0 commit comments

Comments
 (0)