mfgames-project-setup-flake/src/configs/treefmt.nix

40 lines
709 B
Nix

inputs @ { pkgs, ... }:
let
data = {
formatter = {
nix = {
command = "nixpkgs-fmt";
includes = [ "*.nix" ];
};
prettier = {
command = "${pkgs.nodePackages.prettier}/bin/prettier";
options = [ "--write" ];
includes = [
"*.css"
"*.html"
"*.js"
"*.json"
"*.jsx"
"*.md"
"*.mdx"
"*.scss"
"*.ts"
"*.yaml"
];
excludes = [ "**.min.js" ];
};
rust = {
command = "rustfmt";
options = [ "--edition" "2021" ];
includes = [ "*.rs" ];
};
};
};
in
{
inherit data;
output = "treefmt.toml";
}