Commit fe25b65
authored
feat(prettier): indent for class definition (#6059)
trying to match the output for:
https://github.com/prettier/prettier/blob/5b868377c0a8805486156223401e051724689e6f/tests/format/typescript/classes/__snapshots__/format.test.js.snap#L3-L92
<details><summary>main branch output:</summary>
```typescript
class MyContractSelectionWidget extends React.Component<void, MyContractSelectionWidgetPropsType, void> implements SomethingLarge {
method() {}
}
class DisplayObject1 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class DisplayObject2 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class DisplayObject3 extends utils.EventEmitter implements interaction_InteractiveTarget, somethingElse_SomeOtherThing, somethingElseAgain_RunningOutOfNames {}
class DisplayObject4 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}
class Foo extends Immutable.Record({
ipaddress: "",
}) {
ipaddress: string;
}
export class VisTimelineComponent implements AfterViewInit, OnChanges, OnDestroy {}
export class VisTimelineComponent2 implements AfterViewInit, OnChanges, OnDestroy, AndSomethingReallyReallyLong {}
```
</details>
<details><summary>this branch output:</summary>
```typescript
class MyContractSelectionWidget
extends React.Component<void, MyContractSelectionWidgetPropsType, void>
implements SomethingLarge
{
method() {}
}
class DisplayObject1
extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class DisplayObject2
extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class DisplayObject3
extends utils.EventEmitter
implements
interaction_InteractiveTarget,
somethingElse_SomeOtherThing,
somethingElseAgain_RunningOutOfNames {}
class DisplayObject4
extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class Readable
extends events.EventEmitter
implements NodeJS_ReadableStream {}
class InMemoryAppender
extends log4javascript.Appender
implements ICachedLogMessageProvider {}
class Foo extends Immutable.Record({
ipaddress: "",
}) {
ipaddress: string;
}
export class VisTimelineComponent
implements AfterViewInit, OnChanges, OnDestroy {}
export class VisTimelineComponent2
implements
AfterViewInit,
OnChanges,
OnDestroy,
AndSomethingReallyReallyLong {}
```
</details>
Sadly I can't fix the `class Readable` line :/1 parent abd3a9f commit fe25b65
1 file changed
+107
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
14 | 46 | | |
15 | 47 | | |
16 | 48 | | |
| |||
27 | 59 | | |
28 | 60 | | |
29 | 61 | | |
| 62 | + | |
30 | 63 | | |
31 | | - | |
| 64 | + | |
32 | 65 | | |
33 | 66 | | |
34 | 67 | | |
35 | | - | |
| 68 | + | |
36 | 69 | | |
37 | 70 | | |
38 | 71 | | |
39 | | - | |
| 72 | + | |
40 | 73 | | |
41 | 74 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
52 | 81 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 82 | + | |
64 | 83 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
| 87 | + | |
| 88 | + | |
70 | 89 | | |
71 | 90 | | |
72 | 91 | | |
| |||
98 | 117 | | |
99 | 118 | | |
100 | 119 | | |
101 | | - | |
102 | | - | |
103 | 120 | | |
104 | 121 | | |
105 | 122 | | |
| |||
354 | 371 | | |
355 | 372 | | |
356 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
0 commit comments