Add workaround for prettier bug

prettier creates a node_modules folder when formatting some files, which
it should not as cache is not enabled. Setting the cache to a file works
around this.

See https://github.com/prettier/prettier/issues/13032
This commit is contained in:
Archit Gupta 2024-11-27 00:42:20 -08:00
parent ac75d63fa8
commit 1af817b598

View File

@ -20,7 +20,8 @@ in
formatters = pkgs:
let
nixpkgs-fmt = "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt";
prettier = "${pkgs.nodePackages.prettier}/bin/prettier --write";
prettier = "${pkgs.nodePackages.prettier}/bin/prettier --write"
+ " --cache-location=.prettiercache";
in
{
"*.nix" = mkDefault nixpkgs-fmt;