Make default formatter not depend on devShell.packages

This commit is contained in:
Archit Gupta 2023-12-05 22:54:01 -08:00
parent 81371a8bf4
commit 68a0941bbd

View File

@ -17,12 +17,17 @@ in
pkgs.nodePackages.prettier
];
formatters = {
"*.nix" = "nixpkgs-fmt";
"*.md" = "prettier --write";
"*.json" = "prettier --write";
"*.yaml" = "prettier --write";
"*.yml" = "prettier --write";
};
formatters = pkgs:
let
nixpkgs-fmt = "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt";
prettier = "${pkgs.nodePackages.prettier}/bin/prettier --write";
in
{
"*.nix" = nixpkgs-fmt;
"*.md" = prettier;
"*.json" = prettier;
"*.yaml" = prettier;
"*.yml" = prettier;
};
};
}