@@ -64,9 +64,9 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
64
64
- [ FreshMark] ( #freshmark ) aka markdown
65
65
- [ Antlr4] ( #antlr4 ) ([ antlr4formatter] ( #antlr4formatter ) )
66
66
- [ SQL] ( #sql ) ([ dbeaver] ( #dbeaver ) , [ prettier] ( #prettier ) )
67
- - [ Typescript] ( #typescript ) ([ tsfmt] ( #tsfmt ) , [ prettier] ( #prettier ) , [ ESLint] ( #eslint-typescript ) , [ Rome ] ( #rome ) )
68
- - [ Javascript] ( #javascript ) ([ prettier] ( #prettier ) , [ ESLint] ( #eslint-javascript ) , [ Rome ] ( #rome ) )
69
- - [ JSON] ( #json ) ([ simple] ( #simple ) , [ gson] ( #gson ) , [ jackson] ( #jackson ) , [ rome ] ( #rome ) , [ jsonPatch] ( #jsonPatch ) )
67
+ - [ Typescript] ( #typescript ) ([ tsfmt] ( #tsfmt ) , [ prettier] ( #prettier ) , [ ESLint] ( #eslint-typescript ) , [ Biome ] ( #biome ) )
68
+ - [ Javascript] ( #javascript ) ([ prettier] ( #prettier ) , [ ESLint] ( #eslint-javascript ) , [ Biome ] ( #biome ) )
69
+ - [ JSON] ( #json ) ([ simple] ( #simple ) , [ gson] ( #gson ) , [ jackson] ( #jackson ) , [ Biome ] ( #biome ) , [ jsonPatch] ( #jsonPatch ) )
70
70
- [ YAML] ( #yaml )
71
71
- [ Gherkin] ( #gherkin )
72
72
- Multiple languages
@@ -76,7 +76,7 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
76
76
- c, c++, c#, objective-c, protobuf, javascript, java
77
77
- [ eclipse web tools platform] ( #eclipse-web-tools-platform )
78
78
- css, html, js, json, xml
79
- - [ Rome ] ( #rome ) ([ binary detection] ( #rome -binary ) , [ config file] ( #rome -configuration-file ) , [ input language] ( #rome -input-language ) )
79
+ - [ Biome ] ( #biome ) ([ binary detection] ( #biome -binary ) , [ config file] ( #biome -configuration-file ) , [ input language] ( #biome -input-language ) )
80
80
- ** Language independent**
81
81
- [ Generic steps] ( #generic-steps )
82
82
- [ License header] ( #license-header ) ([ slurp year from git] ( #retroactively-slurp-years-from-git-history ) )
@@ -650,7 +650,7 @@ spotless {
650
650
tsfmt() // has its own section below
651
651
prettier() // has its own section below
652
652
eslint() // has its own section below
653
- rome() // has its own section below
653
+ biome() // has its own section below
654
654
655
655
licenseHeader '/* (C) $YEAR */', '(import|const|declare|export|var) ' // or licenseHeaderFile
656
656
// note the '(import|const|...' argument - this is a regex which identifies the top
@@ -743,7 +743,7 @@ spotless {
743
743
744
744
prettier() // has its own section below
745
745
eslint() // has its own section below
746
- rome() // has its own section below
746
+ biome() // has its own section below
747
747
748
748
licenseHeader '/* (C) $YEAR */', 'REGEX_TO_DEFINE_TOP_OF_FILE' // or licenseHeaderFile
749
749
}
@@ -810,7 +810,7 @@ spotless {
810
810
eclipseWtp('json') // see Eclipse web tools platform section
811
811
gson() // has its own section below
812
812
jackson() // has its own section below
813
- rome() // has its own section below
813
+ biome() // has its own section below
814
814
jsonPatch([]) // has its own section below
815
815
}
816
816
}
@@ -1150,15 +1150,20 @@ Unlike Eclipse, Spotless WTP ignores per default external URIs in schema locatio
1150
1150
external entities. To allow the access of external URIs, set the property `resolveExternalURI`
1151
1151
to true.
1152
1152
1153
- ## Rome
1153
+ ## Biome
1154
1154
1155
- [homepage](https://rome.tools/). [changelog](https://github.com/rome/tools/blob/main/CHANGELOG.md). Rome is a formatter that for the Frontend written in Rust, which has a native binary,
1156
- does not require Node.js and as such, is pretty fast. It can currently format
1157
- JavaScript, TypeScript, JSX, and JSON, and may support
1158
- [more frontend languages](https://docs.rome.tools/internals/language_support/)
1159
- such as CSS in the future.
1155
+ [homepage](https://biomejs.dev/). [changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG.md). Biome is
1156
+ a formatter that for the frontend written in Rust, which has a native binary, does not require Node.js and as such,
1157
+ is pretty fast. It can currently format JavaScript, TypeScript, JSX, and JSON, and may support
1158
+ [more frontend languages](https://biomejs.dev/internals/language-support/) such as CSS in the future.
1160
1159
1161
- You can use rome in any language-specific format for supported languages, but
1160
+ Note: Biome [was formerly called Rome](https://biomejs.dev/blog/annoucing-biome/). Configurations with
1161
+ the old `<rome>` tag and `rome(...)` function are still supported for the time being. This will be removed
1162
+ in a future version, you should migrate to the new `<biome>` tag or `biome(...)` function. The configuration
1163
+ remains the same, you only need to update the version. If you are using a custom `rome.json` configuration file,
1164
+ you need to rename it to `biome.json`.
1165
+
1166
+ You can use Biome in any language-specific format for supported languages, but
1162
1167
usually you will be creating a generic format.
1163
1168
1164
1169
```gradle
@@ -1167,72 +1172,73 @@ spotless {
1167
1172
// you have to set the target manually
1168
1173
target 'src/*/webapp/**/*.js'
1169
1174
1170
- // Download Rome from the network if not already downloaded, see below for more info
1171
- rome('12.0 .0')
1175
+ // Download Biome from the network if not already downloaded, see below for more info
1176
+ biome('1.2 .0')
1172
1177
1173
- // (optional) Path to the directory with the rome .json conig file
1174
- rome('12.0 .0').configPath("path/config/dir")
1178
+ // (optional) Path to the directory with the biome .json conig file
1179
+ biome('1.2 .0').configPath("path/config/dir")
1175
1180
1176
- // (optional) Rome will auto detect the language based on the file extension.
1181
+ // (optional) Biome will auto detect the language based on the file extension.
1177
1182
// See below for possible values.
1178
- rome('12.0 .0').language("js")
1183
+ biome('1.2 .0').language("js")
1179
1184
}
1180
1185
}
1181
1186
```
1182
1187
1183
1188
**Limitations:**
1189
+
1184
1190
- The auto-discovery of config files (up the file tree) will not work when using
1185
- Rome within spotless.
1191
+ Biome within spotless.
1186
1192
1187
- To apply Rome to more kinds of files with a different configuration, just add
1193
+ To apply Biome to more kinds of files with a different configuration, just add
1188
1194
more formats:
1189
1195
1190
1196
```gradle
1191
1197
spotless {
1192
- format 'rome -js', {
1198
+ format 'biome -js', {
1193
1199
target '**/*.js'
1194
- rome('12.0 .0')
1200
+ biome('1.2 .0')
1195
1201
}
1196
- format 'rome -ts', {
1202
+ format 'biome -ts', {
1197
1203
target '**/*.ts'
1198
- rome('12.0 .0')
1204
+ biome('1.2 .0')
1199
1205
}
1200
- format 'rome -json', {
1206
+ format 'biome -json', {
1201
1207
target '**/*.json'
1202
- rome('12.0 .0')
1208
+ biome('1.2 .0')
1203
1209
}
1204
1210
}
1205
1211
```
1206
1212
1207
- ### Rome binary
1213
+ ### Biome binary
1208
1214
1209
- To format with Rome , spotless needs to find the Rome binary. By default,
1215
+ To format with Biome , spotless needs to find the Biome binary. By default,
1210
1216
spotless downloads the binary for the given version from the network. This
1211
1217
should be fine in most cases, but may not work e.g. when there is not connection
1212
1218
to the internet.
1213
1219
1214
- To download the Rome binary from the network, just specify a version:
1220
+ To download the Biome binary from the network, just specify a version:
1215
1221
1216
1222
```gradle
1217
1223
spotless {
1218
- format 'rome ', {
1224
+ format 'biome ', {
1219
1225
target '**/*.js','**/ * .ts' ,' ** /* .json'
1220
- rome('12.0 .0')
1226
+ biome('1.2 .0')
1221
1227
}
1222
1228
}
1223
1229
```
1224
1230
1225
- Spotless uses a default version when you do not specfiy a version, but this
1226
- may change at any time, so we recommend that you always set the Rome version
1231
+ Spotless uses a default version when you do not specify a version, but this
1232
+ may change at any time, so we recommend that you always set the Biome version
1227
1233
you want to use. Optionally, you can also specify a directory for the downloaded
1228
- Rome binaries (defaults to `~/.m2/repository/com/diffplug/spotless/spotless-data/rome `):
1234
+ Biome binaries (defaults to `~/.m2/repository/com/diffplug/spotless/spotless-data/biome `):
1229
1235
1230
1236
```gradle
1231
1237
spotless {
1232
- format 'rome ', {
1238
+ format 'biome ', {
1233
1239
target '**/ * .js' ,' ** /* .ts','**/ * .json'
1234
1240
// Relative paths are resolved against the project' s base directory
1235
- rome( ' 12.0 .0' ).downloadDir(" ${project.gradle.gradleUserHomeDir} /rome " )
1241
+ biome( ' 1.2 .0' ).downloadDir(" ${project.gradle.gradleUserHomeDir} /biome " )
1236
1242
}
1237
1243
}
1238
1244
```
@@ -1241,68 +1247,59 @@ To use a fixed binary, omit the `version` and specify a `pathToExe`:
1241
1247
1242
1248
```gradle
1243
1249
spotless {
1244
- format ' rome ' , {
1250
+ format ' biome ' , {
1245
1251
target ' **/*.js' ,' **/*.ts' ,' **/*.json'
1246
- rome ().pathToExe(" ${project.layout.buildDirectory.asFile.get().absolutePath} /bin/rome " )
1252
+ biome ().pathToExe(" ${project.layout.buildDirectory.asFile.get().absolutePath} /bin/biome " )
1247
1253
}
1248
1254
}
1249
1255
```
1250
1256
1251
1257
Absolute paths are used as - is . Relative paths are resolved against the project' s
1252
- base directory. To use a pre-installed Rome binary on the user' s path, specify
1258
+ base directory. To use a pre-installed Biome binary on the user' s path, specify
1253
1259
just a name without any slashes / backslashes:
1254
1260
1255
1261
```gradle
1256
1262
spotless {
1257
- format ' rome ' , {
1263
+ format ' biome ' , {
1258
1264
target ' **/*.js' ,' **/*.ts' ,' **/*.json'
1259
- // Uses the "rome " command, which must be on the user's path. -->
1260
- rome ().pathToExe(' rome ' )
1265
+ // Uses the "biome " command, which must be on the user's path. -->
1266
+ biome ().pathToExe(' biome ' )
1261
1267
}
1262
1268
}
1263
1269
```
1264
1270
1265
- ### Rome configuration file
1271
+ ### Biome configuration file
1266
1272
1267
- Rome is a biased formatter and linter without many options, but there are a few
1268
- basic options. Rome uses a file named [rome .json](https: // docs.rome.tools /configuration/)
1273
+ Biome is a biased formatter and linter without many options, but there are a few
1274
+ basic options. Biome uses a file named [biome .json](https: // biomejs.dev/reference /configuration/)
1269
1275
for its configuration. When none is specified, the default configuration from
1270
- Rome is used. To use a custom configuration:
1276
+ Biome is used. To use a custom configuration:
1271
1277
1272
1278
```gradle
1273
1279
spotless {
1274
- format ' rome ' , {
1280
+ format ' biome ' , {
1275
1281
target ' **/*.js' ,' **/*.ts' ,' **/*.json'
1276
- // Must point to the directory with the "rome .json" config file -->
1282
+ // Must point to the directory with the "biome .json" config file -->
1277
1283
// Relative paths are resolved against the project's base directory -->
1278
- rome( ' 12.0 .0' ).configPath(' ./config' )
1284
+ biome( ' 1.2 .0' ).configPath(' ./config' )
1279
1285
}
1280
1286
}
1281
1287
```
1282
1288
1283
- ### Rome input language
1289
+ ### Biome input language
1284
1290
1285
- By default, Rome detects the language / syntax of the files to format
1291
+ By default, Biome detects the language / syntax of the files to format
1286
1292
automatically from the file extension. This may fail if your source code files
1287
1293
have unusual extensions for some reason. If you are using the generic format,
1288
1294
you can force a certain language like this :
1289
1295
1290
1296
```xml
1291
- < configuration>
1292
- < formats>
1293
- < format>
1294
- <includes>
1295
- <include>src/* */ typescript/* */ * .mjson< / include>
1296
- < / includes>
1297
-
1298
- < rome>
1299
- < version> 12.0 .0 < / version>
1300
- < language> json< / language>
1301
- < / prettier>
1302
- < / rome>
1303
-
1304
- < / formats>
1305
- < / configuration>
1297
+ spotless {
1298
+ format ' biome' , {
1299
+ target ' src/**/typescript/**/*.mjson'
1300
+ biome(' 1.2.0' ).language(' json' )
1301
+ }
1302
+ }
1306
1303
```
1307
1304
1308
1305
The following languages are currently recognized:
0 commit comments