feat(oxfmt): bump bundled Prettier version to 3.9.8 (#26999)

Fixes #26751

Refs: https://github.com/prettier/prettier/releases/tag/3.9.8
This commit is contained in:
leaysgur committed 2026-09-24 00:54:40 +00:00
1 parent b939645e3d
commit 342527d178
17 files changed
+75 -7816

No files matched your search

-81
View File
@@ -2,87 +2,6 @@
Admission reasons and rules: see `crates/oxc_formatter_core/FORMATTER_POLICY.md` "Known divergences".
## template-expression-indent
- Why: invariant (prettier/prettier#19725)
- Pin: `conformance/fixtures/edge-cases/css-in-js/template-expression-indent.js`, `conformance/fixtures/edge-cases/gql-in-js/template-expression-indent.js`, `conformance/fixtures/edge-cases/html-in-js/template-expression-indent.js`
- Conformance: `externals/webawesome/carousel/carousel.ts`, `externals/webawesome/color-picker/color-picker.ts`, `externals/webawesome/input/input.ts`
```js
/* input */
_ = css`
a{
color:
${
a
// comment
+ b}
;
}
`;
/* ours */
_ = css`
a {
color: ${
a +
// comment
b
};
}
`;
/* prettier */
_ = css`
a {
color: ${
a +
// comment
b
};
}
`;
```
A broken `${expr}` inside an embedded template re-indents to the placeholder's position;
Prettier 3.9.6 preserves the source indentation, not a fixpoint: its second pass yields ours.
## broken-template-comment-indent
- Why: invariant
- Pin: `conformance/fixtures/edge-cases/xxx-in-js-comment/broken-template-comment-indent.js`
- Conformance: `externals/prettier/js/multiparser-comments/comment-inside.js`
```js
/* input */
html`
${
foo
/* comment */
}
`;
/* ours */
html`
${
foo
/* comment */
}
`;
/* prettier */
html`
${
foo
/* comment */
}
`;
```
A `${}` whose embed formatting bails (comments force the broken form) still indents its expression to the placeholder, same as `template-expression-indent`;
Prettier prints it at ROOT indent, dropping the embed indent entirely (an artifact of its embed bail-out path), not a fixpoint:
its second pass indents the expression to the placeholder too (at the template body's indent, ` ${` / ` foo`).
## ts-in-vue-generic-trailing-comma
- Why: uniform-rule (embedded script formats like its standalone file)
+5
View File
@@ -89,6 +89,11 @@ const categories: Category[] = [
ext: ".js",
excludes: ["format.test.js"],
},
{
dir: join(EXTERNALS_DIR, "prettier", "js/embeded"),
ext: ".js",
excludes: ["format.test.js"],
},
{
dir: join(EXTERNALS_DIR, "webawesome"),
ext: ".ts",
@@ -26,27 +26,21 @@
## gql-in-js
### Option 1: 11/12 (91.67%)
### Option 1: 12/12 (100.00%)
```json
{"printWidth":80}
```
- [edge-cases/gql-in-js/template-expression-indent.js](diffs/gql-in-js/edge-cases__gql-in-js__template-expression-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
### Option 2: 11/12 (91.67%)
### Option 2: 12/12 (100.00%)
```json
{"printWidth":100}
```
- [edge-cases/gql-in-js/template-expression-indent.js](diffs/gql-in-js/edge-cases__gql-in-js__template-expression-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
## css-in-js
### Option 1: 18/21 (85.71%)
### Option 1: 19/21 (90.48%)
```json
{"printWidth":80}
@@ -54,12 +48,10 @@
- [edge-cases/css-in-js/styled-extend-tag.js](diffs/css-in-js/edge-cases__css-in-js__styled-extend-tag.js.md)
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
- [edge-cases/css-in-js/template-expression-indent.js](diffs/css-in-js/edge-cases__css-in-js__template-expression-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/prettier/js/multiparser-css/styled-components.js](diffs/css-in-js/externals__prettier__js__multiparser-css__styled-components.js.md)
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
### Option 2: 18/21 (85.71%)
### Option 2: 19/21 (90.48%)
```json
{"printWidth":100}
@@ -67,33 +59,27 @@
- [edge-cases/css-in-js/styled-extend-tag.js](diffs/css-in-js/edge-cases__css-in-js__styled-extend-tag.js.md)
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
- [edge-cases/css-in-js/template-expression-indent.js](diffs/css-in-js/edge-cases__css-in-js__template-expression-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/prettier/js/multiparser-css/styled-components.js](diffs/css-in-js/externals__prettier__js__multiparser-css__styled-components.js.md)
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
## html-in-js
### Option 1: 168/194 (86.60%)
### Option 1: 173/197 (87.82%)
```json
{"printWidth":80}
```
- [edge-cases/html-in-js/template-expression-indent.js](diffs/html-in-js/edge-cases__html-in-js__template-expression-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/webawesome/badge/badge.ts](diffs/html-in-js/externals__webawesome__badge__badge.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/button/button.ts](diffs/html-in-js/externals__webawesome__button__button.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/callout/callout.ts](diffs/html-in-js/externals__webawesome__callout__callout.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/carousel/carousel.ts](diffs/html-in-js/externals__webawesome__carousel__carousel.ts.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/webawesome/checkbox/checkbox.ts](diffs/html-in-js/externals__webawesome__checkbox__checkbox.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/color-picker/color-picker.ts](diffs/html-in-js/externals__webawesome__color-picker__color-picker.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/copy-button/copy-button.ts](diffs/html-in-js/externals__webawesome__copy-button__copy-button.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/details/details.ts](diffs/html-in-js/externals__webawesome__details__details.ts.md)
@@ -105,7 +91,7 @@
- [externals/webawesome/format-number/format-number.ts](diffs/html-in-js/externals__webawesome__format-number__format-number.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/input/input.ts](diffs/html-in-js/externals__webawesome__input__input.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/number-input/number-input.styles.ts](diffs/html-in-js/externals__webawesome__number-input__number-input.styles.ts.md)
- crates/oxc_formatter_css/DIVERGENCES.md#fill-break-position
- [externals/webawesome/number-input/number-input.ts](diffs/html-in-js/externals__webawesome__number-input__number-input.ts.md)
@@ -133,22 +119,16 @@
- [externals/webawesome/textarea/textarea.ts](diffs/html-in-js/externals__webawesome__textarea__textarea.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
### Option 2: 181/194 (93.30%)
### Option 2: 187/197 (94.92%)
```json
{"printWidth":100,"htmlWhitespaceSensitivity":"ignore"}
```
- [edge-cases/html-in-js/template-expression-indent.js](diffs/html-in-js/edge-cases__html-in-js__template-expression-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/webawesome/button/button.ts](diffs/html-in-js/externals__webawesome__button__button.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/callout/callout.ts](diffs/html-in-js/externals__webawesome__callout__callout.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/carousel/carousel.ts](diffs/html-in-js/externals__webawesome__carousel__carousel.ts.md)
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/webawesome/color-picker/color-picker.ts](diffs/html-in-js/externals__webawesome__color-picker__color-picker.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
- [externals/webawesome/copy-button/copy-button.ts](diffs/html-in-js/externals__webawesome__copy-button__copy-button.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/format-number/format-number.ts](diffs/html-in-js/externals__webawesome__format-number__format-number.ts.md)
@@ -156,7 +136,7 @@
- [externals/webawesome/icon/icon.ts](diffs/html-in-js/externals__webawesome__icon__icon.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/input/input.ts](diffs/html-in-js/externals__webawesome__input__input.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/page/page.ts](diffs/html-in-js/externals__webawesome__page__page.ts.md)
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
- [externals/webawesome/popup/popup.ts](diffs/html-in-js/externals__webawesome__popup__popup.ts.md)
@@ -196,28 +176,18 @@
## xxx-in-js-comment
### Option 1: 4/6 (66.67%)
### Option 1: 6/6 (100.00%)
```json
{"printWidth":80}
```
- [edge-cases/xxx-in-js-comment/broken-template-comment-indent.js](diffs/xxx-in-js-comment/edge-cases__xxx-in-js-comment__broken-template-comment-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
- [externals/prettier/js/multiparser-comments/comment-inside.js](diffs/xxx-in-js-comment/externals__prettier__js__multiparser-comments__comment-inside.js.md)
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
### Option 2: 4/6 (66.67%)
### Option 2: 6/6 (100.00%)
```json
{"printWidth":100}
```
- [edge-cases/xxx-in-js-comment/broken-template-comment-indent.js](diffs/xxx-in-js-comment/edge-cases__xxx-in-js-comment__broken-template-comment-indent.js.md)
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
- [externals/prettier/js/multiparser-comments/comment-inside.js](diffs/xxx-in-js-comment/externals__prettier__js__multiparser-comments__comment-inside.js.md)
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
## svelte
### Option 1: 79/79 (100.00%)
@@ -1,129 +0,0 @@
# edge-cases/css-in-js/template-expression-indent.js
## Option 1
`````json
{"printWidth":80}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -2,10 +2,10 @@
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = css`
a {
color: ${
- a +
- // comment
- b
- };
+ a +
+ // comment
+ b
+ };
}
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = css`
a {
color: ${
a +
// comment
b
};
}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = css`
a {
color: ${
a +
// comment
b
};
}
`;
`````
## Option 2
`````json
{"printWidth":100}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -2,10 +2,10 @@
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = css`
a {
color: ${
- a +
- // comment
- b
- };
+ a +
+ // comment
+ b
+ };
}
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = css`
a {
color: ${
a +
// comment
b
};
}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = css`
a {
color: ${
a +
// comment
b
};
}
`;
`````
@@ -1,119 +0,0 @@
# edge-cases/gql-in-js/template-expression-indent.js
## Option 1
`````json
{"printWidth":80}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -1,9 +1,9 @@
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = gql`
${
- a +
- // comment
- b
- }
+ a +
+ // comment
+ b
+ }
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = gql`
${
a +
// comment
b
}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = gql`
${
a +
// comment
b
}
`;
`````
## Option 2
`````json
{"printWidth":100}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -1,9 +1,9 @@
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = gql`
${
- a +
- // comment
- b
- }
+ a +
+ // comment
+ b
+ }
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = gql`
${
a +
// comment
b
}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = gql`
${
a +
// comment
b
}
`;
`````
@@ -1,367 +0,0 @@
# edge-cases/html-in-js/template-expression-indent.js
## Option 1
`````json
{"printWidth":80}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -2,11 +2,11 @@
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = html`
<div>
${
- a + //
- b
- }
+ a + //
+ b
+ }
</div>
`;
// prettier/prettier#19518: nested embeds were not idempotent
@@ -19,10 +19,10 @@
entry.children
? html`
<ol>
${entry.children.map(
- (child) => html`<li>${child.title}</li>`,
- )}
+ (child) => html`<li>${child.title}</li>`,
+ )}
</ol>
`
: entry.title
}
@@ -36,16 +36,16 @@
return html`
<div>
<pre>
${JSON.stringify({
- a: 1,
- b: 2,
- })}</pre>
+ a: 1,
+ b: 2,
+ })}</pre>
</div>
`;
}
const a = html`
${{
- c: y,
- }}
+ c: y,
+ }}
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = html`
<div>
${
a + //
b
}
</div>
`;
// prettier/prettier#19518: nested embeds were not idempotent
const t = html`
<ol>
${items.map(
(entry) => html`
<li>
${
entry.children
? html`
<ol>
${entry.children.map(
(child) => html`<li>${child.title}</li>`,
)}
</ol>
`
: entry.title
}
</li>
`,
)}
</ol>
`;
export function foo() {
return html`
<div>
<pre>
${JSON.stringify({
a: 1,
b: 2,
})}</pre>
</div>
`;
}
const a = html`
${{
c: y,
}}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = html`
<div>
${
a + //
b
}
</div>
`;
// prettier/prettier#19518: nested embeds were not idempotent
const t = html`
<ol>
${items.map(
(entry) => html`
<li>
${
entry.children
? html`
<ol>
${entry.children.map(
(child) => html`<li>${child.title}</li>`,
)}
</ol>
`
: entry.title
}
</li>
`,
)}
</ol>
`;
export function foo() {
return html`
<div>
<pre>
${JSON.stringify({
a: 1,
b: 2,
})}</pre>
</div>
`;
}
const a = html`
${{
c: y,
}}
`;
`````
## Option 2
`````json
{"printWidth":100,"htmlWhitespaceSensitivity":"ignore"}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -2,11 +2,11 @@
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = html`
<div>
${
- a + //
- b
- }
+ a + //
+ b
+ }
</div>
`;
// prettier/prettier#19518: nested embeds were not idempotent
@@ -19,12 +19,12 @@
entry.children
? html`
<ol>
${entry.children.map(
- (child) => html`
- <li>${child.title}</li>
- `,
- )}
+ (child) => html`
+ <li>${child.title}</li>
+ `,
+ )}
</ol>
`
: entry.title
}
@@ -38,16 +38,16 @@
return html`
<div>
<pre>
${JSON.stringify({
- a: 1,
- b: 2,
- })}</pre>
+ a: 1,
+ b: 2,
+ })}</pre>
</div>
`;
}
const a = html`
${{
- c: y,
- }}
+ c: y,
+ }}
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = html`
<div>
${
a + //
b
}
</div>
`;
// prettier/prettier#19518: nested embeds were not idempotent
const t = html`
<ol>
${items.map(
(entry) => html`
<li>
${
entry.children
? html`
<ol>
${entry.children.map(
(child) => html`
<li>${child.title}</li>
`,
)}
</ol>
`
: entry.title
}
</li>
`,
)}
</ol>
`;
export function foo() {
return html`
<div>
<pre>
${JSON.stringify({
a: 1,
b: 2,
})}</pre>
</div>
`;
}
const a = html`
${{
c: y,
}}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: embedded `${expr}` re-indents to the placeholder (Prettier preserves the source indentation);
// see apps/oxfmt/DIVERGENCES.md#template-expression-indent
_ = html`
<div>
${
a + //
b
}
</div>
`;
// prettier/prettier#19518: nested embeds were not idempotent
const t = html`
<ol>
${items.map(
(entry) => html`
<li>
${
entry.children
? html`
<ol>
${entry.children.map(
(child) => html`
<li>${child.title}</li>
`,
)}
</ol>
`
: entry.title
}
</li>
`,
)}
</ol>
`;
export function foo() {
return html`
<div>
<pre>
${JSON.stringify({
a: 1,
b: 2,
})}</pre>
</div>
`;
}
const a = html`
${{
c: y,
}}
`;
`````
@@ -75,55 +75,6 @@
/** Enables spell checking on the input. */
@property({
type: Boolean,
@@ -503,28 +523,28 @@
@click=${this.handlePasswordToggle}
tabindex="-1"
>
${
- !this.passwordVisible
- ? html`
- <slot name="show-password-icon">
- <wa-icon
- name="eye"
- library="system"
- variant="regular"
- ></wa-icon>
- </slot>
- `
- : html`
- <slot name="hide-password-icon">
- <wa-icon
- name="eye-slash"
- library="system"
- variant="regular"
- ></wa-icon>
- </slot>
- `
- }
+ !this.passwordVisible
+ ? html`
+ <slot name="show-password-icon">
+ <wa-icon
+ name="eye"
+ library="system"
+ variant="regular"
+ ></wa-icon>
+ </slot>
+ `
+ : html`
+ <slot name="hide-password-icon">
+ <wa-icon
+ name="eye-slash"
+ library="system"
+ variant="regular"
+ ></wa-icon>
+ </slot>
+ `
+ }
</button>
`
: ""
}
`````
@@ -1221,26 +1172,26 @@ export default class WaInput extends WebAwesomeFormAssociatedElement {
tabindex="-1"
>
${
!this.passwordVisible
? html`
<slot name="show-password-icon">
<wa-icon
name="eye"
library="system"
variant="regular"
></wa-icon>
</slot>
`
: html`
<slot name="hide-password-icon">
<wa-icon
name="eye-slash"
library="system"
variant="regular"
></wa-icon>
</slot>
`
}
!this.passwordVisible
? html`
<slot name="show-password-icon">
<wa-icon
name="eye"
library="system"
variant="regular"
></wa-icon>
</slot>
`
: html`
<slot name="hide-password-icon">
<wa-icon
name="eye-slash"
library="system"
variant="regular"
></wa-icon>
</slot>
`
}
</button>
`
: ""
@@ -1307,39 +1258,6 @@ declare global {
/**
* Only required for SSR. Set to `true` if you're slotting in a `label` element so the server-rendered markup
* includes the label before the component hydrates on the client.
@@ -466,20 +473,20 @@
@click=${this.handlePasswordToggle}
tabindex="-1"
>
${
- !this.passwordVisible
- ? html`
- <slot name="show-password-icon">
- <wa-icon name="eye" library="system" variant="regular"></wa-icon>
- </slot>
- `
- : html`
- <slot name="hide-password-icon">
- <wa-icon name="eye-slash" library="system" variant="regular"></wa-icon>
- </slot>
- `
- }
+ !this.passwordVisible
+ ? html`
+ <slot name="show-password-icon">
+ <wa-icon name="eye" library="system" variant="regular"></wa-icon>
+ </slot>
+ `
+ : html`
+ <slot name="hide-password-icon">
+ <wa-icon name="eye-slash" library="system" variant="regular"></wa-icon>
+ </slot>
+ `
+ }
</button>
`
: ""
}
`````
@@ -2343,18 +2261,18 @@ export default class WaInput extends WebAwesomeFormAssociatedElement {
tabindex="-1"
>
${
!this.passwordVisible
? html`
<slot name="show-password-icon">
<wa-icon name="eye" library="system" variant="regular"></wa-icon>
</slot>
`
: html`
<slot name="hide-password-icon">
<wa-icon name="eye-slash" library="system" variant="regular"></wa-icon>
</slot>
`
}
!this.passwordVisible
? html`
<slot name="show-password-icon">
<wa-icon name="eye" library="system" variant="regular"></wa-icon>
</slot>
`
: html`
<slot name="hide-password-icon">
<wa-icon name="eye-slash" library="system" variant="regular"></wa-icon>
</slot>
`
}
</button>
`
: ""
@@ -1,111 +0,0 @@
# edge-cases/xxx-in-js-comment/broken-template-comment-indent.js
## Option 1
`````json
{"printWidth":80}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -1,8 +1,8 @@
// DIVERGES: broken `${}` holding comments indents to the placeholder;
// see apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
html`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: broken `${}` holding comments indents to the placeholder;
// see apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
html`
${
foo
/* comment */
}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: broken `${}` holding comments indents to the placeholder;
// see apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
html`
${
foo
/* comment */
}
`;
`````
## Option 2
`````json
{"printWidth":100}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -1,8 +1,8 @@
// DIVERGES: broken `${}` holding comments indents to the placeholder;
// see apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
html`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
`````
### Actual (oxfmt)
`````js
// DIVERGES: broken `${}` holding comments indents to the placeholder;
// see apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
html`
${
foo
/* comment */
}
`;
`````
### Expected (prettier)
`````js
// DIVERGES: broken `${}` holding comments indents to the placeholder;
// see apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
html`
${
foo
/* comment */
}
`;
`````
@@ -1,413 +0,0 @@
# externals/prettier/js/multiparser-comments/comment-inside.js
## Option 1
`````json
{"printWidth":80}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -13,11 +13,11 @@
/* comment */
}`;
html`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
graphql`
${
@@ -26,11 +26,11 @@
}
`;
graphql`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
css`
${
@@ -39,11 +39,11 @@
}
`;
css`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
markdown`${
foo
`````
### Actual (oxfmt)
`````js
// #9274
html`
<div>
${
this.set && this.set.artist
/* avoid console errors if `this.set` is undefined */
}
</div>
`;
html`${
foo
/* comment */
}`;
html`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
markdown`${
foo
/* comment */
}`;
markdown`
${
foo
/* comment */
}
`;
// https://github.com/prettier/prettier/pull/9278#issuecomment-700589195
expr1 = html`
<div>
${x(
foo, // fg
bar,
)}
</div>
`;
`````
### Expected (prettier)
`````js
// #9274
html`
<div>
${
this.set && this.set.artist
/* avoid console errors if `this.set` is undefined */
}
</div>
`;
html`${
foo
/* comment */
}`;
html`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
markdown`${
foo
/* comment */
}`;
markdown`
${
foo
/* comment */
}
`;
// https://github.com/prettier/prettier/pull/9278#issuecomment-700589195
expr1 = html`
<div>
${x(
foo, // fg
bar,
)}
</div>
`;
`````
## Option 2
`````json
{"printWidth":100}
`````
### Diff
`````diff
===================================================================
--- prettier
+++ oxfmt
@@ -13,11 +13,11 @@
/* comment */
}`;
html`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
graphql`
${
@@ -26,11 +26,11 @@
}
`;
graphql`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
css`
${
@@ -39,11 +39,11 @@
}
`;
css`
${
- foo
- /* comment */
-}
+ foo
+ /* comment */
+ }
`;
markdown`${
foo
`````
### Actual (oxfmt)
`````js
// #9274
html`
<div>
${
this.set && this.set.artist
/* avoid console errors if `this.set` is undefined */
}
</div>
`;
html`${
foo
/* comment */
}`;
html`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
markdown`${
foo
/* comment */
}`;
markdown`
${
foo
/* comment */
}
`;
// https://github.com/prettier/prettier/pull/9278#issuecomment-700589195
expr1 = html`
<div>
${x(
foo, // fg
bar,
)}
</div>
`;
`````
### Expected (prettier)
`````js
// #9274
html`
<div>
${
this.set && this.set.artist
/* avoid console errors if `this.set` is undefined */
}
</div>
`;
html`${
foo
/* comment */
}`;
html`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
graphql`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
css`
${
foo
/* comment */
}
`;
markdown`${
foo
/* comment */
}`;
markdown`
${
foo
/* comment */
}
`;
// https://github.com/prettier/prettier/pull/9278#issuecomment-700589195
expr1 = html`
<div>
${x(
foo, // fg
bar,
)}
</div>
`;
`````
+1 -1
View File
@@ -20,7 +20,7 @@
"generate-config-types": "node scripts/generate-config-types.ts"
},
"dependencies": {
"prettier": "3.9.6",
"prettier": "3.9.8",
"prettier-plugin-svelte": "4.1.1",
"prettier-plugin-tailwindcss": "0.0.0-insiders.19faf8b",
"tinypool": "2.2.0"
@@ -72,6 +72,7 @@ const IGNORE: &[&str] = &[
"js/babel-plugins",
// Embedded languages in template literals
"js/comments-closure-typecast/styled-components.js",
"js/embeded",
"js/multiparser",
"typescript/multiparser",
"typescript/angular-component-examples",
+3 -88
View File
@@ -34,7 +34,7 @@ text
A document whose first block is a thematic break gets `***`, never `---`:
the next run (Prettier's and ours) would read `---` ... `---` as front matter and swallow `text` into it,
which is what the input itself would be with a `---` at the end (`front-matter.md`).
Prettier `main` prints `***` since #19839; the pin (3.9.6) still prints `---`.
Prettier `main` prints `***` since #19839; the pin (3.9.8) still prints `---`.
## url-escaping
@@ -111,34 +111,6 @@ so an indent written as spaces plus a tab becomes a fenced block.
A blockquote's trailing blank `>` line is dropped, whatever `proseWrap` is.
Prettier drops it under `preserve` and `never` but prints a bare `>` under `always` when the block before it is `prettier-ignore`d.
## list-indented-code-alignment
- Why: semantics (prettier/prettier#19644, prettier/prettier#19647, prettier/prettier#19990)
- Pin: `tests/fixtures/markdown/tab-width-4/list-indented-code-alignment.md`
```markdown
<!-- input, tabWidth 4 -->
- foo
code
<!-- ours -->
- foo
code
<!-- prettier -->
- foo
code
```
An indented code block inside a list item is printed at the item's content column + 4, nothing more:
the code's content is exactly what follows that column, so any extra alignment becomes part of it on the next parse.
The pin aligns it by the task checkbox (continuation lines drift by 4 per run, #19644);
#19647 aligned it by the tab width instead, which shifted the content whenever `tabWidth` exceeded the marker width.
Prettier `main` prints it as we do since #19990 (the fixture's first four items are its fixture); the pin (3.9.6) still differs.
## ordered-marker-before-indented-code
- Why: semantics
@@ -157,7 +129,7 @@ Prettier `main` prints it as we do since #19990 (the fixture's first four items
The marker of an ordered list stays unpadded when an item starts with indented code:
the content column is the marker plus one space, so any padding lands inside the code
(the rule of DIVERGENCES.md#list-indented-code-alignment, applied to the marker).
(the rule indented code in a list item follows, applied to the marker).
Prettier pads it when the code starts at a tab stop in the source, which `>2. foo` does only because of the `>`.
## list-html-block-alignment
@@ -182,7 +154,7 @@ Prettier pads it when the code starts at a tab stop in the source, which `>2.
<textarea>
```
An HTML block after a task item's paragraph keeps the item's content column, as indented code does (DIVERGENCES.md#list-indented-code-alignment).
An HTML block after a task item's paragraph keeps the item's content column, as indented code does.
Prettier drops the alignment when the html starts at another column than the paragraph (the checkbox counts for its printer, not for the parser), which moves the block out of the item.
## html-block-trailing-newline
@@ -239,63 +211,6 @@ Prettier prints it as a blank line of the blockquote, and inside a list item tha
Adjacent lists alternate markers so they stay two lists. A list kept verbatim by `prettier-ignore` shows its own marker, so the list after it takes the other one;
Prettier alternates from the marker it would have printed (`-`), prints `*` next to the verbatim `*` list, and the two merge into one list on the next parse.
## single-tilde-strikethrough
- Why: semantics (prettier/prettier#19739)
- Pin: `tests/fixtures/markdown/single-tilde-strikethrough.md`
- Conformance: `markdown/gfm-test-suite/snippet: example-491.md`
```markdown
<!-- input -->
H~2~O
<!-- ours -->
H~2~O
<!-- prettier -->
H~~2~~O
```
A single-tilde span is not strikethrough (GitHub strikes `~~x~~` only) and is kept as written.
The pin (3.9.6) parses it as strikethrough and rewrites it to `~~`, turning subscripts into strikes;
Prettier `main` preserves it since #19739.
## liquid-flow-tags
- Why: semantics (prettier/prettier#19724, prettier/prettier#19838)
- Pin: `tests/fixtures/markdown/prose-wrap/liquid-flow-tags.md`
- Conformance: `markdown/liquid/character-after-closing-tokens.md`, `markdown/liquid/example-1.md`, `markdown/liquid/example-2.md`
```markdown
<!-- input -->
{% css a %}
{% js b %}
{{ foo
bar baz }}
<!-- ours -->
{% css a %}
{% js b %}
{{ foo
bar baz }}
<!-- prettier, proseWrap always -->
{% css a %} {% js b %}
{{ foo
bar baz }}
```
A liquid tag standing on its own line is a flow node: it is kept verbatim, blank lines inside included,
and two tags on adjacent lines stay on their lines.
The pin (3.9.6) reads them as inline tags in a paragraph, so `always` joins them and a tag spanning a blank line falls apart into paragraphs whose whitespace collapses;
Prettier `main` parses them as flow nodes since #19838.
## container-directive
- Why: semantics
@@ -137,7 +137,7 @@ fn write_list_item<'a>(
let body = format_with(|f| block::write_block(child, &item.children, i, child_parent, f));
// An indented code block's content is whatever follows the item's content column + 4:
// any extra alignment lands inside the code on the next parse.
// See DIVERGENCES.md#list-indented-code-alignment and DIVERGENCES.md#list-html-block-alignment.
// See DIVERGENCES.md#list-html-block-alignment.
// (Prettier's checkbox align before #19647, the same for prettier/prettier#19986)
if is_indented_code(child) || matches!(child, Block::HtmlBlock(_)) {
write!(f, body);
@@ -2,7 +2,7 @@
source: crates/oxc_formatter_markdown/tests/conformance.rs
expression: report
---
markdown compatibility: 1245/1261 (98.73%), 0 files skipped
markdown compatibility: 1262/1274 (99.06%), 0 files skipped
# Failed
@@ -17,10 +17,6 @@ markdown compatibility: 1245/1261 (98.73%), 0 files skipped
| markdown/commonmark-test-suite/snippet: example-52.md (Thematic breaks) | 💥 | 0.00% |
| markdown/commonmark-test-suite/snippet: example-53.md (Thematic breaks) | 💥 | 0.00% |
| markdown/commonmark-test-suite/snippet: example-54.md (Thematic breaks) | 💥 | 0.00% |
| markdown/gfm-test-suite/snippet: example-491.md (6.5 Strikethrough (extension)) | 💥 | 0.00% |
| markdown/link/encodedLink.md | 💥 | 86.67% |
| markdown/liquid/character-after-closing-tokens.md | 💥✨ | 41.18% |
| markdown/liquid/example-1.md | 💥✨ | 43.48% |
| markdown/liquid/example-2.md | 💥💥 | 90.48% |
| markdown/paragraph/cjk.md | 💥💥✨ | 60.00% |
| markdown/thematicBreak/simple.md | 💥 | 0.00% |
+13 -13
View File
@@ -175,14 +175,14 @@ importers:
apps/oxfmt:
dependencies:
prettier:
specifier: 3.9.6
version: 3.9.6
specifier: 3.9.8
version: 3.9.8
prettier-plugin-svelte:
specifier: 4.1.1
version: 4.1.1(prettier@3.9.6)(svelte@5.57.1(@typescript-eslint/types@8.69.0))
version: 4.1.1(prettier@3.9.8)(svelte@5.57.1(@typescript-eslint/types@8.69.0))
prettier-plugin-tailwindcss:
specifier: 0.0.0-insiders.19faf8b
version: 0.0.0-insiders.19faf8b(prettier-plugin-svelte@4.1.1(prettier@3.9.6)(svelte@5.57.1(@typescript-eslint/types@8.69.0)))(prettier@3.9.6)
version: 0.0.0-insiders.19faf8b(prettier-plugin-svelte@4.1.1(prettier@3.9.8)(svelte@5.57.1(@typescript-eslint/types@8.69.0)))(prettier@3.9.8)
tinypool:
specifier: 2.2.0
version: 2.2.0
@@ -5340,8 +5340,8 @@ packages:
prettier-plugin-svelte:
optional: true
prettier@3.9.6:
resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==}
prettier@3.9.8:
resolution: {integrity: sha512-WRFq3Wn3WId7LLROfMLdH7xaFr2jR62wU8nLO6rQUOLOxNZUviyJQs1M0iIhLexSFy+L+w0ch66wtoO2jRjG0A==}
engines: {node: '>=14'}
hasBin: true
@@ -9906,7 +9906,7 @@ snapshots:
js-yaml: 5.4.1
lodash: 4.18.1
minimist: 1.2.8
prettier: 3.9.6
prettier: 3.9.8
tinyglobby: 0.2.17
json-schema-traverse@0.4.1: {}
@@ -10524,18 +10524,18 @@ snapshots:
prelude-ls@1.2.1: {}
prettier-plugin-svelte@4.1.1(prettier@3.9.6)(svelte@5.57.1(@typescript-eslint/types@8.69.0)):
prettier-plugin-svelte@4.1.1(prettier@3.9.8)(svelte@5.57.1(@typescript-eslint/types@8.69.0)):
dependencies:
prettier: 3.9.6
prettier: 3.9.8
svelte: 5.57.1(@typescript-eslint/types@8.69.0)
prettier-plugin-tailwindcss@0.0.0-insiders.19faf8b(prettier-plugin-svelte@4.1.1(prettier@3.9.6)(svelte@5.57.1(@typescript-eslint/types@8.69.0)))(prettier@3.9.6):
prettier-plugin-tailwindcss@0.0.0-insiders.19faf8b(prettier-plugin-svelte@4.1.1(prettier@3.9.8)(svelte@5.57.1(@typescript-eslint/types@8.69.0)))(prettier@3.9.8):
dependencies:
prettier: 3.9.6
prettier: 3.9.8
optionalDependencies:
prettier-plugin-svelte: 4.1.1(prettier@3.9.6)(svelte@5.57.1(@typescript-eslint/types@8.69.0))
prettier-plugin-svelte: 4.1.1(prettier@3.9.8)(svelte@5.57.1(@typescript-eslint/types@8.69.0))
prettier@3.9.6: {}
prettier@3.9.8: {}
pretty-format@27.5.1:
dependencies: