Class PrettierStyle

java.lang.Object
org.openrewrite.style.NamedStyles
org.openrewrite.javascript.style.PrettierStyle
All Implemented Interfaces:
org.openrewrite.marker.Marker, org.openrewrite.rpc.RpcCodec<PrettierStyle>

public class PrettierStyle extends org.openrewrite.style.NamedStyles implements org.openrewrite.rpc.RpcCodec<PrettierStyle>
Marker containing the resolved Prettier configuration for a source file.

This marker is added by the parser when a Prettier config is detected in the project. The config is resolved per-file (with overrides applied), so files with different override rules will have different marker instances.

When this marker is present, AutoformatVisitor will use Prettier for formatting instead of the built-in formatting visitors.

  • Constructor Details

  • Method Details

    • withId

      public PrettierStyle withId(UUID id)
      Specified by:
      withId in interface org.openrewrite.marker.Marker
      Overrides:
      withId in class org.openrewrite.style.NamedStyles
    • withConfig

      public PrettierStyle withConfig(Map<String,Object> config)
    • withPrettierVersion

      public PrettierStyle withPrettierVersion(String prettierVersion)
    • withIgnored

      public PrettierStyle withIgnored(boolean ignored)
    • withStyles

      public PrettierStyle withStyles(Collection<org.openrewrite.style.Style> styles)
      Overrides:
      withStyles in class org.openrewrite.style.NamedStyles
    • rpcSend

      public void rpcSend(PrettierStyle after, org.openrewrite.rpc.RpcSendQueue q)
      Specified by:
      rpcSend in interface org.openrewrite.rpc.RpcCodec<PrettierStyle>
    • rpcReceive

      public PrettierStyle rpcReceive(PrettierStyle before, org.openrewrite.rpc.RpcReceiveQueue q)
      Specified by:
      rpcReceive in interface org.openrewrite.rpc.RpcCodec<PrettierStyle>