Package com.diffplug.spotless.rome
Class RomeStep
- java.lang.Object
-
- com.diffplug.spotless.rome.RomeStep
-
public class RomeStep extends java.lang.Object
formatter step that formats JavaScript and TypeScript code with Biome: https://github.com/biomejs/biome. It delegates to the Biome executable. The Rome executable is downloaded from the network when no executable path is provided explicitly.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatterStep
create()
Creates a formatter step with the current configuration, which formats code by passing it to the Biome executable.java.lang.String
name()
RomeStep
withConfigPath(java.lang.String configPath)
Sets the path to the directory with thebiome.json
config file.static RomeStep
withExeDownload(BiomeFlavor flavor, java.lang.String version, java.lang.String downloadDir)
Creates a Biome step that format code by downloading to the given Biome version.static RomeStep
withExePath(BiomeFlavor flavor, java.lang.String pathToExe)
Creates a Biome step that formats code by delegating to the Biome executable located at the given path.RomeStep
withLanguage(java.lang.String language)
Sets the language of the files to format When no language is set, it is determined automatically from the file name.
-
-
-
Method Detail
-
name
public java.lang.String name()
- Returns:
- The name of this format step, i.e.
biome
orrome
.
-
withExeDownload
public static RomeStep withExeDownload(BiomeFlavor flavor, java.lang.String version, java.lang.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 RomeStep withExePath(BiomeFlavor flavor, java.lang.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 RomeStep withConfigPath(java.lang.String configPath)
Sets the path to the directory with thebiome.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 namedbiome.json
.- Returns:
- This builder instance for chaining method calls.
-
withLanguage
public RomeStep withLanguage(java.lang.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)
- json (JSON)
- Parameters:
language
- The language of the files to format.- Returns:
- This builder instance for chaining method calls.
-
-