Skip to content

Commit 68e636a

Browse files
committed
fixup! WIP: Add Gradle bindings for JSON formatter
1 parent 1287b3d commit 68e636a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

plugin-gradle/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Spotless supports all of Gradle's built-in performance features (incremental bui
6868
- [Antlr4](#antlr4) ([antlr4formatter](#antlr4formatter))
6969
- [SQL](#sql) ([dbeaver](#dbeaver), [prettier](#prettier))
7070
- [Typescript](#typescript) ([tsfmt](#tsfmt), [prettier](#prettier))
71+
- [JSON](#json)
7172
- Multiple languages
7273
- [Prettier](#prettier) ([plugins](#prettier-plugins), [npm detection](#npm-detection), [`.npmrc` detection](#npmrc-detection))
7374
- javascript, jsx, angular, vue, flow, typescript, css, less, scss, html, json, graphql, markdown, ymaml
@@ -527,6 +528,21 @@ spotless {
527528
528529
For details, see the [npm detection](#npm-detection) and [`.npmrc` detection](#npmrc-detection) sections of prettier, which apply also to tsfmt.
529530
531+
## JSON
532+
533+
- `com.diffplug.gradle.spotless.JsonExtension` [javadoc](https://javadoc.io/static/com.diffplug.spotless/spotless-plugin-gradle/5.12.4/com/diffplug/gradle/spotless/JsonExtension.html), [code](https://github.com/diffplug/spotless/blob/main/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/JsonExtension.java)
534+
535+
```gradle
536+
spotless {
537+
json {
538+
target '**/*.json' // you have to set the target manually
539+
540+
indentWithSpaces(6)
541+
indentWithTabs()
542+
}
543+
}
544+
```
545+
530546
<a name="applying-prettier-to-javascript--flow--typescript--css--scss--less--jsx--graphql--yaml--etc"></a>
531547
532548
## Prettier

0 commit comments

Comments
 (0)