mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-05 21:17:37 +03:00
Updated Home (markdown)
parent
0743d452c8
commit
a54beb9a00
58
Home.md
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",
|
||||
]
|
||||
```
|
Loading…
Reference in New Issue
Block a user