Skip to content

Commit 3b1f320

Browse files
committed
Fix trailing whitespace in debug output so prettier stops creating diffs
1 parent 7450bad commit 3b1f320

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

packages/transform/__tests__/debug.test.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,77 +33,77 @@ describe('Debug utilities', () => {
3333
| Mapping: Template
3434
| hbs(0:50): hbs\`\\\\n <HelperComponent @foo={{this.bar}} />\\\\n \`
3535
| ts(0:277): (() => {\\\\n hbs;\\\\n let χ!: typeof import(\\"@glint/environment-glimmerx/types\\");\\\\n return χ.template(function(𝚪: import(\\"@glint/environment-glimmerx/types\\").ResolveContext<MyComponent>) {\\\\n χ.invokeBlock(χ.resolve(HelperComponent)({ foo: 𝚪.this.bar }), {});\\\\n 𝚪;\\\\n });\\\\n})()
36-
|
36+
|
3737
| | Mapping: Identifier
38-
| | hbs(0:0):
38+
| | hbs(0:0):
3939
| | ts(170:181): MyComponent
40-
| |
40+
| |
4141
| | Mapping: ElementNode
4242
| | hbs(9:46): <HelperComponent @foo={{this.bar}} />
4343
| | ts(186:259): χ.invokeBlock(χ.resolve(HelperComponent)({ foo: 𝚪.this.bar }), {});
44-
| |
44+
| |
4545
| | | Mapping: ElementNode
4646
| | | hbs(9:46): <HelperComponent @foo={{this.bar}} />
4747
| | | ts(186:259): χ.invokeBlock(χ.resolve(HelperComponent)({ foo: 𝚪.this.bar }), {});
48-
| | |
48+
| | |
4949
| | | | Mapping: Identifier
5050
| | | | hbs(10:25): HelperComponent
5151
| | | | ts(214:229): HelperComponent
52-
| | | |
52+
| | | |
5353
| | | | Mapping: AttrNode
5454
| | | | hbs(26:43): @foo={{this.bar}}
5555
| | | | ts(233:249): foo: 𝚪.this.bar
56-
| | | |
56+
| | | |
5757
| | | | | Mapping: Identifier
5858
| | | | | hbs(27:30): foo
5959
| | | | | ts(233:236): foo
60-
| | | | |
60+
| | | | |
6161
| | | | | Mapping: MustacheStatement
6262
| | | | | hbs(31:43): {{this.bar}}
6363
| | | | | ts(238:249): 𝚪.this.bar
64-
| | | | |
64+
| | | | |
6565
| | | | | | Mapping: PathExpression
6666
| | | | | | hbs(33:41): this.bar
6767
| | | | | | ts(238:249): 𝚪.this.bar
68-
| | | | | |
68+
| | | | | |
6969
| | | | | | | Mapping: Identifier
7070
| | | | | | | hbs(33:37): this
7171
| | | | | | | ts(241:245): this
72-
| | | | | | |
72+
| | | | | | |
7373
| | | | | | | Mapping: Identifier
7474
| | | | | | | hbs(38:41): bar
7575
| | | | | | | ts(246:249): bar
76-
| | | | | | |
77-
| | | | | |
78-
| | | | |
79-
| | | |
80-
| | |
81-
| |
82-
|
76+
| | | | | | |
77+
| | | | | |
78+
| | | | |
79+
| | | |
80+
| | |
81+
| |
82+
|
8383
8484
| Mapping: Template
8585
| hbs(0:28): hbs\`\\\\n Hello, {{@foo}}\\\\n \`
8686
| ts(0:262): (() => {\\\\n hbs;\\\\n let χ!: typeof import(\\"@glint/environment-glimmerx/types\\");\\\\n return χ.template(function(𝚪: import(\\"@glint/environment-glimmerx/types\\").ResolveContext<HelperComponent>) {\\\\n χ.invokeEmit(χ.resolveOrReturn(𝚪.args.foo)({}));\\\\n 𝚪;\\\\n });\\\\n})()
87-
|
87+
|
8888
| | Mapping: Identifier
89-
| | hbs(0:0):
89+
| | hbs(0:0):
9090
| | ts(170:185): HelperComponent
91-
| |
91+
| |
9292
| | Mapping: MustacheStatement
9393
| | hbs(16:24): {{@foo}}
9494
| | ts(190:242): χ.invokeEmit(χ.resolveOrReturn(𝚪.args.foo)({}))
95-
| |
95+
| |
9696
| | | Mapping: PathExpression
9797
| | | hbs(18:22): @foo
9898
| | | ts(225:236): 𝚪.args.foo
99-
| | |
99+
| | |
100100
| | | | Mapping: Identifier
101101
| | | | hbs(19:22): foo
102102
| | | | ts(233:236): foo
103-
| | | |
104-
| | |
105-
| |
106-
| "
103+
| | | |
104+
| | |
105+
| |
106+
|"
107107
`);
108108
});
109109
});

packages/transform/src/mapping-tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ export default class MappingTree {
9898
lines.push(indent);
9999
}
100100

101-
return lines.join('\n');
101+
return lines.map((line) => line.trimEnd()).join('\n');
102102
}
103103
}

0 commit comments

Comments
 (0)