Skip to content

Commit 342527d

Browse files
committed
1 parent b939645 commit 342527d

17 files changed

Lines changed: 102 additions & 7843 deletions

‎apps/oxfmt/DIVERGENCES.md‎

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -2,87 +2,6 @@
22

33
Admission reasons and rules: see `crates/oxc_formatter_core/FORMATTER_POLICY.md` "Known divergences".
44

5-
## template-expression-indent
6-
7-
- Why: invariant (prettier/prettier#19725)
8-
- 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`
9-
- Conformance: `externals/webawesome/carousel/carousel.ts`, `externals/webawesome/color-picker/color-picker.ts`, `externals/webawesome/input/input.ts`
10-
11-
```js
12-
/* input */
13-
_ = css`
14-
a{
15-
color:
16-
${
17-
a
18-
// comment
19-
+ b}
20-
;
21-
}
22-
`;
23-
24-
/* ours */
25-
_ = css`
26-
a {
27-
color: ${
28-
a +
29-
// comment
30-
b
31-
};
32-
}
33-
`;
34-
35-
/* prettier */
36-
_ = css`
37-
a {
38-
color: ${
39-
a +
40-
// comment
41-
b
42-
};
43-
}
44-
`;
45-
```
46-
47-
A broken `${expr}` inside an embedded template re-indents to the placeholder's position;
48-
Prettier 3.9.6 preserves the source indentation, not a fixpoint: its second pass yields ours.
49-
50-
## broken-template-comment-indent
51-
52-
- Why: invariant
53-
- Pin: `conformance/fixtures/edge-cases/xxx-in-js-comment/broken-template-comment-indent.js`
54-
- Conformance: `externals/prettier/js/multiparser-comments/comment-inside.js`
55-
56-
```js
57-
/* input */
58-
html`
59-
${
60-
foo
61-
/* comment */
62-
}
63-
`;
64-
65-
/* ours */
66-
html`
67-
${
68-
foo
69-
/* comment */
70-
}
71-
`;
72-
73-
/* prettier */
74-
html`
75-
${
76-
foo
77-
/* comment */
78-
}
79-
`;
80-
```
81-
82-
A `${}` whose embed formatting bails (comments force the broken form) still indents its expression to the placeholder, same as `template-expression-indent`;
83-
Prettier prints it at ROOT indent, dropping the embed indent entirely (an artifact of its embed bail-out path), not a fixpoint:
84-
its second pass indents the expression to the placeholder too (at the template body's indent, ` ${` / ` foo`).
85-
865
## ts-in-vue-generic-trailing-comma
876

887
- Why: uniform-rule (embedded script formats like its standalone file)

‎apps/oxfmt/conformance/run.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ const categories: Category[] = [
8989
ext: ".js",
9090
excludes: ["format.test.js"],
9191
},
92+
{
93+
dir: join(EXTERNALS_DIR, "prettier", "js/embeded"),
94+
ext: ".js",
95+
excludes: ["format.test.js"],
96+
},
9297
{
9398
dir: join(EXTERNALS_DIR, "webawesome"),
9499
ext: ".ts",

‎apps/oxfmt/conformance/snapshots/conformance.snap.md‎

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,74 +26,60 @@
2626

2727
## gql-in-js
2828

29-
### Option 1: 11/12 (91.67%)
29+
### Option 1: 12/12 (100.00%)
3030

3131
```json
3232
{"printWidth":80}
3333
```
3434

35-
- [edge-cases/gql-in-js/template-expression-indent.js](diffs/gql-in-js/edge-cases__gql-in-js__template-expression-indent.js.md)
36-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
37-
38-
### Option 2: 11/12 (91.67%)
35+
### Option 2: 12/12 (100.00%)
3936

4037
```json
4138
{"printWidth":100}
4239
```
4340

44-
- [edge-cases/gql-in-js/template-expression-indent.js](diffs/gql-in-js/edge-cases__gql-in-js__template-expression-indent.js.md)
45-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
46-
4741
## css-in-js
4842

49-
### Option 1: 18/21 (85.71%)
43+
### Option 1: 19/21 (90.48%)
5044

5145
```json
5246
{"printWidth":80}
5347
```
5448

5549
- [edge-cases/css-in-js/styled-extend-tag.js](diffs/css-in-js/edge-cases__css-in-js__styled-extend-tag.js.md)
5650
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
57-
- [edge-cases/css-in-js/template-expression-indent.js](diffs/css-in-js/edge-cases__css-in-js__template-expression-indent.js.md)
58-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
5951
- [externals/prettier/js/multiparser-css/styled-components.js](diffs/css-in-js/externals__prettier__js__multiparser-css__styled-components.js.md)
6052
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
6153

62-
### Option 2: 18/21 (85.71%)
54+
### Option 2: 19/21 (90.48%)
6355

6456
```json
6557
{"printWidth":100}
6658
```
6759

6860
- [edge-cases/css-in-js/styled-extend-tag.js](diffs/css-in-js/edge-cases__css-in-js__styled-extend-tag.js.md)
6961
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
70-
- [edge-cases/css-in-js/template-expression-indent.js](diffs/css-in-js/edge-cases__css-in-js__template-expression-indent.js.md)
71-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
7262
- [externals/prettier/js/multiparser-css/styled-components.js](diffs/css-in-js/externals__prettier__js__multiparser-css__styled-components.js.md)
7363
- apps/oxfmt/DIVERGENCES.md#styled-extend-tag
7464

7565
## html-in-js
7666

77-
### Option 1: 168/194 (86.60%)
67+
### Option 1: 173/197 (87.82%)
7868

7969
```json
8070
{"printWidth":80}
8171
```
8272

83-
- [edge-cases/html-in-js/template-expression-indent.js](diffs/html-in-js/edge-cases__html-in-js__template-expression-indent.js.md)
84-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
8573
- [externals/webawesome/badge/badge.ts](diffs/html-in-js/externals__webawesome__badge__badge.ts.md)
8674
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
8775
- [externals/webawesome/button/button.ts](diffs/html-in-js/externals__webawesome__button__button.ts.md)
8876
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
8977
- [externals/webawesome/callout/callout.ts](diffs/html-in-js/externals__webawesome__callout__callout.ts.md)
9078
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
91-
- [externals/webawesome/carousel/carousel.ts](diffs/html-in-js/externals__webawesome__carousel__carousel.ts.md)
92-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
9379
- [externals/webawesome/checkbox/checkbox.ts](diffs/html-in-js/externals__webawesome__checkbox__checkbox.ts.md)
9480
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
9581
- [externals/webawesome/color-picker/color-picker.ts](diffs/html-in-js/externals__webawesome__color-picker__color-picker.ts.md)
96-
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
82+
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
9783
- [externals/webawesome/copy-button/copy-button.ts](diffs/html-in-js/externals__webawesome__copy-button__copy-button.ts.md)
9884
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
9985
- [externals/webawesome/details/details.ts](diffs/html-in-js/externals__webawesome__details__details.ts.md)
@@ -105,7 +91,7 @@
10591
- [externals/webawesome/format-number/format-number.ts](diffs/html-in-js/externals__webawesome__format-number__format-number.ts.md)
10692
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
10793
- [externals/webawesome/input/input.ts](diffs/html-in-js/externals__webawesome__input__input.ts.md)
108-
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
94+
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
10995
- [externals/webawesome/number-input/number-input.styles.ts](diffs/html-in-js/externals__webawesome__number-input__number-input.styles.ts.md)
11096
- crates/oxc_formatter_css/DIVERGENCES.md#fill-break-position
11197
- [externals/webawesome/number-input/number-input.ts](diffs/html-in-js/externals__webawesome__number-input__number-input.ts.md)
@@ -133,30 +119,24 @@
133119
- [externals/webawesome/textarea/textarea.ts](diffs/html-in-js/externals__webawesome__textarea__textarea.ts.md)
134120
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
135121

136-
### Option 2: 181/194 (93.30%)
122+
### Option 2: 187/197 (94.92%)
137123

138124
```json
139125
{"printWidth":100,"htmlWhitespaceSensitivity":"ignore"}
140126
```
141127

142-
- [edge-cases/html-in-js/template-expression-indent.js](diffs/html-in-js/edge-cases__html-in-js__template-expression-indent.js.md)
143-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
144128
- [externals/webawesome/button/button.ts](diffs/html-in-js/externals__webawesome__button__button.ts.md)
145129
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
146130
- [externals/webawesome/callout/callout.ts](diffs/html-in-js/externals__webawesome__callout__callout.ts.md)
147131
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
148-
- [externals/webawesome/carousel/carousel.ts](diffs/html-in-js/externals__webawesome__carousel__carousel.ts.md)
149-
- apps/oxfmt/DIVERGENCES.md#template-expression-indent
150-
- [externals/webawesome/color-picker/color-picker.ts](diffs/html-in-js/externals__webawesome__color-picker__color-picker.ts.md)
151-
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
152132
- [externals/webawesome/copy-button/copy-button.ts](diffs/html-in-js/externals__webawesome__copy-button__copy-button.ts.md)
153133
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
154134
- [externals/webawesome/format-number/format-number.ts](diffs/html-in-js/externals__webawesome__format-number__format-number.ts.md)
155135
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
156136
- [externals/webawesome/icon/icon.ts](diffs/html-in-js/externals__webawesome__icon__icon.ts.md)
157137
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
158138
- [externals/webawesome/input/input.ts](diffs/html-in-js/externals__webawesome__input__input.ts.md)
159-
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry, apps/oxfmt/DIVERGENCES.md#template-expression-indent
139+
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
160140
- [externals/webawesome/page/page.ts](diffs/html-in-js/externals__webawesome__page__page.ts.md)
161141
- crates/oxc_formatter/DIVERGENCES.md#union-annotation-flat-retry
162142
- [externals/webawesome/popup/popup.ts](diffs/html-in-js/externals__webawesome__popup__popup.ts.md)
@@ -196,28 +176,18 @@
196176

197177
## xxx-in-js-comment
198178

199-
### Option 1: 4/6 (66.67%)
179+
### Option 1: 6/6 (100.00%)
200180

201181
```json
202182
{"printWidth":80}
203183
```
204184

205-
- [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)
206-
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
207-
- [externals/prettier/js/multiparser-comments/comment-inside.js](diffs/xxx-in-js-comment/externals__prettier__js__multiparser-comments__comment-inside.js.md)
208-
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
209-
210-
### Option 2: 4/6 (66.67%)
185+
### Option 2: 6/6 (100.00%)
211186

212187
```json
213188
{"printWidth":100}
214189
```
215190

216-
- [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)
217-
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
218-
- [externals/prettier/js/multiparser-comments/comment-inside.js](diffs/xxx-in-js-comment/externals__prettier__js__multiparser-comments__comment-inside.js.md)
219-
- apps/oxfmt/DIVERGENCES.md#broken-template-comment-indent
220-
221191
## svelte
222192

223193
### Option 1: 79/79 (100.00%)

‎apps/oxfmt/conformance/snapshots/diffs/css-in-js/edge-cases__css-in-js__template-expression-indent.js.md‎

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)