Class BiomeStep

java.lang.Object
com.diffplug.spotless.biome.BiomeStep

public class BiomeStep extends Object
formatter step that formats JavaScript and TypeScript code with Biome: https://github.com/biomejs/biome. It delegates to the Biome executable. The Biome executable is downloaded from the network when no executable path is provided explicitly.
  • Method Details

    • name

      public String name()
      Returns:
      The name of this format step, i.e. biome or rome.
    • withExeDownload

      public static BiomeStep withExeDownload(BiomeFlavor flavor, String version, String downloadDir)
      Creates a Biome step that format code by downloading to the given Biome version. The executable is downloaded from the network.
      Parameters:
      flavor - Flavor of Biome to use.
      version - Version of the Biome executable to download.
      downloadDir - Directory where to place the downloaded executable.
      Returns:
      A new Biome step that download the executable from the network.
    • withExePath

      public static BiomeStep withExePath(BiomeFlavor flavor, String pathToExe)
      Creates a Biome step that formats code by delegating to the Biome executable located at the given path.
      Parameters:
      flavor - Flavor of Biome to use.
      pathToExe - Path to the Biome executable to use.
      Returns:
      A new Biome step that format with the given executable.
    • create

      public FormatterStep create()
      Creates a formatter step with the current configuration, which formats code by passing it to the Biome executable.
      Returns:
      A new formatter step for formatting with Biome.
    • withConfigPath

      public BiomeStep withConfigPath(String configPath)
      Sets the path to the directory with the biome.json config file. When no config path is set, the default configuration is used.
      Parameters:
      configPath - Config path to use. Must point to a directory which contains a file named biome.json.
      Returns:
      This builder instance for chaining method calls.
    • withLanguage

      public BiomeStep withLanguage(String language)
      Sets the language of the files to format When no language is set, it is determined automatically from the file name. The following languages are currently supported by Biome.
      • js (JavaScript)
      • jsx (JavaScript + JSX)
      • js? (JavaScript or JavaScript + JSX, depending on the file extension)
      • ts (TypeScript)
      • tsx (TypeScript + JSX)
      • ts? (TypeScript or TypeScript + JSX, depending on the file extension)
      • css (CSS, requires biome >= 1.9.0)
      • json (JSON)
      • jsonc (JSON + comments)
      Parameters:
      language - The language of the files to format.
      Returns:
      This builder instance for chaining method calls.