Package com.diffplug.gradle.spotless
Class FormatExtension.BiomeGeneric
java.lang.Object
com.diffplug.gradle.spotless.BiomeStepConfig<FormatExtension.BiomeGeneric>
com.diffplug.gradle.spotless.FormatExtension.BiomeGeneric
- Enclosing class:
FormatExtension
Generic Biome formatter step that detects the language of the input file from
the file name. It should be specified as a formatter step for a generic
format{ ... }
.-
Constructor Summary
ConstructorsConstructorDescriptionBiomeGeneric
(String version) Creates a new Biome config that downloads the Biome executable for the given version from the network. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Gets the language (syntax) of the input files to format.protected FormatExtension.BiomeGeneric
getThis()
Sets the language (syntax) of the input files to format.Methods inherited from class com.diffplug.gradle.spotless.BiomeStepConfig
configPath, createStep, downloadDir, pathToExe, replaceStep
-
Constructor Details
-
BiomeGeneric
Creates a new Biome config that downloads the Biome executable for the given version from the network.- Parameters:
version
- Biome version to use. The default version is used whennull
.
-
-
Method Details
-
language
Sets the language (syntax) of the input files to format. Whennull
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)
- Parameters:
language
- The language of the files to format.- Returns:
- This step for further configuration.
-
getLanguage
Description copied from class:BiomeStepConfig
Gets the language (syntax) of the input files to format. Whennull
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)
- Specified by:
getLanguage
in classBiomeStepConfig<FormatExtension.BiomeGeneric>
- Returns:
- The language of the input files.
-
getThis
- Specified by:
getThis
in classBiomeStepConfig<FormatExtension.BiomeGeneric>
- Returns:
- This Biome config instance.
-