Clean changelog_unreleased

This commit is contained in:
Sosuke Suzuki committed 2025-02-09 20:45:20 +09:00
1 parent 9b6afe27e9
commit 3fe8152c5c
14 files changed
+3 -338

No files matched your search

-27
View File
@@ -1,27 +0,0 @@
#### Improve line breaks inside ICU blocks (#16922 by @fisker)
<!-- prettier-ignore -->
```html
<!-- Input -->
<span>The author is {gender, select, male {male} female {female} other {other}}</span>
<span>The author is <span>male consectetur adipiscing elit, sed do eiusmod</span></span>
<!-- Prettier stable -->
<span
>The author is {gender, select, male {male} female {female} other {other}
}</span>
<span
>The author is
<span>male consectetur adipiscing elit, sed do eiusmod</span></span
>
<!-- Prettier main -->
<span
>The author is
{gender, select, male {male} female {female} other {other}}</span
>
<span
>The author is
<span>male consectetur adipiscing elit, sed do eiusmod</span></span
>
```
-36
View File
@@ -1,36 +0,0 @@
#### Fix extra new line inside ICU blocks (#16922 by @fisker)
<!-- prettier-ignore -->
```html
<!-- Input -->
{active, select,
true {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temp
}
false {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temp
}
}
<!-- Prettier stable -->
{active, select,
true {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temp
}
false {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temp
}
}
<!-- Prettier main -->
{active, select,
true {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temp
}
false {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod temp
}
}
```
-42
View File
@@ -1,42 +0,0 @@
#### [HIGHLIGHT]Add support for TypeScript config files (#16828 by @itsyoboieltr & @fisker)
Added new format of configuration files:
- `.prettierrc.ts`
- `.prettierrc.mts`
- `.prettierrc.cts`
- `prettier.config.ts`
- `prettier.config.mts`
- `prettier.config.cts`
Note:
Currently TypeScript support in Node.js is experimental.
To make TypeScript config files work, Node.js>=22.6.0 is required and Node.js v22 requires `--experimental-strip-types`.
You can run prettier with
```sh
node --experimental-strip-types node_modules/prettier/bin/prettier.cjs . --write
```
or
```sh
NODE_OPTIONS="--experimental-strip-types" prettier . --write
```
Other TS loaders should also work, but not tested, use at your own risk.
For example, with [`tsx`](https://tsx.is/), you can
```sh
node --import tsx node_modules/prettier/bin/prettier.cjs . --write
```
or
```sh
tsx node_modules/prettier/bin/prettier.cjs . --write
```
-22
View File
@@ -1,22 +0,0 @@
#### Support read config from `package.json` with JSONC syntax on Bun (#17041 by @fisker)
[Bun 1.2 added JSONC support in `package.json`](https://bun.sh/blog/bun-v1.2#jsonc-support-in-package-json), in previous version of Prettier, it will ignore `prettier` config in it. Since Prettier main, we can read `prettier` config from it without error.
However, since it's just a Bun feature and not supported by Node.js, it can only work when running Prettier with Bun.
Important note: Prettier uses [`json-stringify` parser](https://prettier.io/docs/en/options#parser) to format `package.json` file by default, to support formatting `package.json` file with JSONC syntax, you need override the parser option
```js
export default {
overrides: [
{
files: ["package.json"],
options: {
parser: "jsonc",
},
},
],
};
```
If you can't upgrade Prettier for some reason, you can still use JSONC syntax in `package.json`, but don't put your `prettier` config in it, you'll have to use another [configuration file](https://prettier.io/docs/en/configuration).
-28
View File
@@ -1,28 +0,0 @@
#### Break before breaking comma separated values (#16907 by @seiyab)
<!-- prettier-ignore -->
```css
/* Input */
a {
background-image:
linear-gradient(to bottom, rgb(255 255 0 / 50%), rgb(0 0 255 / 50%)),
url("catfront.png");
}
/* Prettier stable */
a {
background-image: linear-gradient(
to bottom,
rgb(255 255 0 / 50%),
rgb(0 0 255 / 50%)
),
url("catfront.png");
}
/* Prettier main */
a {
background-image:
linear-gradient(to bottom, rgb(255 255 0 / 50%), rgb(0 0 255 / 50%)),
url("catfront.png");
}
```
-12
View File
@@ -1,12 +0,0 @@
#### Support `const` type parameters in Flow (#16947 by @gkz)
<!-- prettier-ignore -->
```jsx
function f<const T>(): void {}
// Prettier stable
// Parse error
// Prettier main
function f<const T>(): void {}
```
-40
View File
@@ -1,40 +0,0 @@
#### Handle `<style>` and `<pre>` tags in Handlebars/Glimmer (#15087 by @jurgenwerk)
<!-- prettier-ignore -->
```handlebars
{{!-- Input --}}
<pre>
cd ~
ls
echo "hey"
</pre>
<style>
.red { color: red }
.blue {
color: red
}
</style>
{{!-- Prettier stable --}}
<pre>
cd ~ ls echo "hey"
</pre>
<style>
.red { color: red } .blue { color: blue }
</style>
{{!-- Prettier main --}}
<pre>
cd ~
ls
echo "hey"
</pre>
<style>
.red {
color: red;
}
.blue {
color: red;
}
</style>
```
-32
View File
@@ -1,32 +0,0 @@
#### [HIGHLIGHT]Implement `objectWrap` config option (#16163 by @pauldraper, @sosukesuzuki)
Prettier has historically done semi-manual formatting of multi-line JavaScript object literals.
Namely, an object is kept on multiple lines if there is a newline prior to the first property, even if it could fit on a single line. See [Multi-line objects](https://prettier.io/docs/rationale#multi-line-objects) for more details.
While this behavior continues to be the default, `--object-wrap=collapse` instead ignores whitespace when formatting object literals.
<!-- prettier-ignore -->
```js
// Input
const obj1 = {
name1: "value1", name2: "value2",
};
const obj2 = { name1: "value1",
name2: "value2",
};
// Prettier stable
const obj1 = {
name1: "value1",
name2: "value2",
};
const obj2 = { name1: "value1", name2: "value2" };
// Prettier main (with `--object-wrapping=collapse`)
const obj1 = { name1: "value1", name2: "value2" };
const obj2 = { name1: "value1", name2: "value2" };
```
-28
View File
@@ -1,28 +0,0 @@
#### Improve word wrapping edge cases in JSX (#16700 by @seiyab)
<!-- prettier-ignore -->
```jsx
// Input
br_triggers_expression_break =
<div><br />
text text text text text text text text text text text {this.props.type} </div>
// Prettier stable
br_triggers_expression_break = (
<div>
<br />
text text text text text text text text text text text {
this.props.type
}{" "}
</div>
);
// Prettier main
br_triggers_expression_break = (
<div>
<br />
text text text text text text text text text text text{" "}
{this.props.type}{" "}
</div>
);
```
-23
View File
@@ -1,23 +0,0 @@
#### [HIGHLIGHT]Add experimental option for breaking lines before binary operators (#7111 by @btmills)
This is implemented behind the `--experimental-operator-position <start|end>` flag.
When binary expressions wrap lines, `start` prints the operators at the start of new lines. Placing binary operators at the beginning of wrapped lines can make the operators more prominent and easier to scan.
<!-- prettier-ignore -->
```jsx
// Input
var a = Math.random() * (yRange * (1 - minVerticalFraction)) + minVerticalFraction * yRange - offset;
// `experimentalOperatorPosition: end` (default behavior)
var a =
Math.random() * (yRange * (1 - minVerticalFraction)) +
minVerticalFraction * yRange -
offset;
// `experimentalOperatorPosition: start`
var a =
Math.random() * (yRange * (1 - minVerticalFraction))
+ minVerticalFraction * yRange
- offset;
```
-22
View File
@@ -1,22 +0,0 @@
#### U+FF5E as CJK punctuation (#16832 by @tats-u)
U+FF5E FULLWIDTH TILDE (~) is commonly used as a substitute for U+301C WAVE DASH (〜) in Windows for Japanese. Full width alphabets are less used in Markdown documents comparing to other types of documents (e.g. Microsoft Office documents), and the full width tilde is much less used as this purpose compared to full width alphabets and digits. Therefore, we can assume that the full width tilde in Markdown documents in the wild are a alternative form of the wave dash and a part of CJK punctuation.
<!-- prettier-ignore -->
```markdown
<!-- Input (--prose-wrap=never) -->
a 字 a 字 a 字
60~
100点
60〜
100点
<!-- Prettier stable -->
a 字 a 字 a 字 60~ 100点 60〜10点
<!-- Prettier main -->
a 字 a 字 a 字 60~10点 60〜100点
```
The first symbol between 60 and 100 in the above example is U+FF5E FULLWIDTH TILDE (~) and the second one is U+301C WAVE DASH (〜).
-5
View File
@@ -1,5 +0,0 @@
#### Use ESM entrypoint for `require(ESM)` (#16958 by @tats-u)
Node.js 22.12 or later [can (experimentally) load ESM modules with `require` function](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require) without runtime flags. This change enables `require` to load Prettier without the CommonJS entrypoint with almost only the ability to import the ESM entrypoint.
The feature to load ES modules with `require` is not completely stable but can be used without ExperimentalWarning as of Node 22.13.
-21
View File
@@ -1,21 +0,0 @@
#### Support `.prop` shorthand (#16920 by @fisker)
`.foo` is shorthand for `v-bind:foo.prop`. See [`v-bind` builtin directive](https://vuejs.org/api/built-in-directives.html#v-bind) for details.
<!-- prettier-ignore -->
```vue
<!-- Input -->
<template>
<button .disabled=" a &&b ">Click!</button>
</template>
<!-- Prettier stable -->
<template>
<button .disabled=" a &&b ">Click!</button>
</template>
<!-- Prettier main -->
<template>
<button .disabled="a && b">Click!</button>
</template>
```
+3
View File
@@ -18,3 +18,6 @@ export default async function cleanChangelog({ repo }) {
await runGit(["commit", "-am", "Clean changelog_unreleased"]);
await runGit(["push", "--repo", repo]);
}
cleanChangelog("git@github.com:prettier/prettier.git");