Updated Home (markdown)

Jörg Thalheim 2022-03-18 16:22:41 +00:00
parent 0743d452c8
commit a54beb9a00

58
Home.md

@ -2,3 +2,61 @@ Welcome to the treefmt wiki!
## Languages
### nix
```
[formatter.nix]
command = "alejandra"
includes = ["*.nix"]
```
### clojure
```
[formatter.clojure]
command = "sh"
options = [
"-euc",
"""
cd backend
clj-kondo --lint "$@"
"""
]
includes = ["*.clj"]
```
### shell
```
[formatter.shell]
command = "sh"
options = [
"-eucx",
"""
# This is a bug in treefmt, the script should not be called without arguments
if [[ $# -le 0 ]]; then exit 0; fi
# First shellcheck
shellcheck --external-sources --source-path=SCRIPTDIR "$@"
# Then format
shfmt -i 2 -s -w "$@"
"""
]
includes = ["*.sh"]
excludes = []
```
```
[formatter.prettier]
command = "prettier"
options = ["--write"]
includes = [
"*.css",
"*.html",
"*.js",
"*.json",
"*.jsx",
"*.md",
"*.mdx",
"*.scss",
"*.ts",
]
```