Add formatter for codebase

This commit is contained in:
Gabriel Arazas 2023-02-25 19:26:52 +08:00
parent d54fd4bc4d
commit 0be49e8295
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 25 additions and 0 deletions

View File

@ -24,5 +24,6 @@
in {
devShells.default = import ./shell.nix { inherit pkgs; };
formatter = pkgs.treefmt;
});
}

24
treefmt.toml Normal file
View File

@ -0,0 +1,24 @@
[formatter.nix]
command = "nixpkgs-fmt"
includes = ["*.nix"]
[formatter.ruby]
command = "rufo"
options = ["-x"]
includes = ["*.rb"]
[formatter.web]
command = "prettier"
options = ["--write"]
includes = [
"*.css",
"*.html",
"*.js",
"*.json",
"*.jsx",
"*.md",
"*.mdx",
"*.scss",
"*.ts",
"*.yaml",
]