Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(prettier): indent for class definition #6059

Merged

Conversation

Sysix
Copy link
Contributor

@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 :/

Copy link

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.

@github-actions github-actions bot added the A-prettier Area - Prettier label Sep 25, 2024
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 force-pushed the feat-oxc-prettier-indent-class-definition branch from 0afb1a2 to 99221a1 Compare September 25, 2024 22:32
@Sysix Sysix force-pushed the feat-oxc-prettier-indent-class-definition branch 2 times, most recently from 87b52ca to f43fe60 Compare September 25, 2024 22:38
@Sysix Sysix force-pushed the feat-oxc-prettier-indent-class-definition branch from 3854c59 to 6aa42cb Compare September 26, 2024 18:27
@Sysix Sysix force-pushed the feat-oxc-prettier-indent-class-definition branch from 0c4cc2e to 772505a Compare October 6, 2024 12:31
@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
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-prettier Area - Prettier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants