Skip to content

Comments

feat(prettier): indent for class definition#6059

Merged
Boshen merged 8 commits intooxc-project:mainfrom
Sysix:feat-oxc-prettier-indent-class-definition
Oct 6, 2024
Merged

feat(prettier): indent for class definition#6059
Boshen merged 8 commits intooxc-project:mainfrom
Sysix:feat-oxc-prettier-indent-class-definition

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Sep 25, 2024

trying to match the output for: https://github.com/prettier/prettier/blob/5b868377c0a8805486156223401e051724689e6f/tests/format/typescript/classes/__snapshots__/format.test.js.snap#L3-L92

main branch output:
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 {}
this branch output:
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 {}

Sadly I can't fix the class Readable line :/

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 25, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 25, 2024

CodSpeed Performance Report

Merging #6059 will not alter performance

Comparing Sysix:feat-oxc-prettier-indent-class-definition (0ed258a) with main (abd3a9f)

Summary

✅ 29 untouched benchmarks

@Sysix Sysix marked this pull request as ready for review October 6, 2024 12:38
@Boshen Boshen merged commit fe25b65 into oxc-project:main Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants