Class BiomeStepConfig<Self extends BiomeStepConfig<Self>>

java.lang.Object
com.diffplug.gradle.spotless.BiomeStepConfig<Self>
Direct Known Subclasses:
CssExtension.BiomeCss, FormatExtension.BiomeGeneric, JavascriptExtension.BiomeJs, JsonExtension.BiomeJson, TypescriptExtension.BiomeTs

public abstract class BiomeStepConfig<Self extends BiomeStepConfig<Self>> extends Object
  • Constructor Details

  • Method Details

    • configPath

      public Self configPath(Object configPath)
      Optional path to the directory with configuration file for Biome. The file must be named biome.json. When none is given, the default configuration is used. If this is a relative path, it is resolved against the project's base directory.
      Returns:
      This step for further configuration.
    • downloadDir

      public Self downloadDir(Object downloadDir)
      Optional directory where the downloaded Biome executable is placed. If this is a relative path, it is resolved against the project's base directory. Defaults to ~/.m2/repository/com/diffplug/spotless/spotless-data/biome.
      Returns:
      This step for further configuration.
    • pathToExe

      public Self pathToExe(Object pathToExe)
      Optional path to the Biome executable. Overwrites the configured version. No attempt is made to download the Biome executable from the network.

      When an absolute path is given, that path is used as-is. When a relative path is given, it is resolved against the project's base directory. When only a file name (i.e. without any slashes or back slash path separators such as biome) is given, this is interpreted as the name of a command with executable that is in your path environment variable. Use ./executable-name if you want to use an executable in the project's base directory.

      Returns:
      This step for further configuration.
    • createStep

      protected FormatterStep createStep()
      Creates a new formatter step that formats code by calling the Biome executable, using the current configuration.
      Returns:
      A new formatter step for the Biome formatter.
    • getLanguage

      protected abstract String getLanguage()
      Gets the language (syntax) of the input files to format. When null or the empty string, the language is detected automatically from the file name. Currently, the following languages are 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)
      Returns:
      The language of the input files.
    • getThis

      protected abstract Self getThis()
      Returns:
      This Biome config instance.
    • replaceStep

      protected void replaceStep()
      Creates a new Biome step and replaces the existing Biome step in the list of format steps.