From 8647e51a1c2af9558eea469a1540488d69659340 Mon Sep 17 00:00:00 2001 From: dawn Date: Mon, 13 Jul 2026 17:03:42 +0300 Subject: [PATCH] nix: add prettier to treefmt for ./web Signed-off-by: dawn --- flake.nix | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index b0ea9da3..e7767418 100644 --- a/flake.nix +++ b/flake.nix @@ -266,17 +266,27 @@ excludes = ["**/src/_lex/**"]; }; - # prettier = let - # wrapper = pkgs.runCommandLocal "prettier-wrapper" {nativeBuildInputs = [pkgs.makeWrapper];} '' - # makeWrapper ${pkgs.prettier}/bin/prettier "$out" --add-flags "--plugin=${pkgs.prettier-plugin-go-template}/lib/node_modules/prettier-plugin-go-template/lib/index.js" - # ''; - # in { - # command = wrapper; - # options = ["-w"]; - # includes = ["*.html"]; - # # causes Go template plugin errors: https://github.com/NiklasPor/prettier-plugin-go-template/issues/120 - # excludes = ["appview/pages/templates/layouts/repobase.html" "appview/pages/templates/repo/tags.html"]; - # }; + prettier = { + command = pkgs.lib.getExe pkgs.prettier; + options = ["-w"]; + includes = [ + "web/**/*.cjs" + "web/**/*.css" + "web/**/*.html" + "web/**/*.js" + "web/**/*.json" + "web/**/*.json5" + "web/**/*.jsx" + "web/**/*.mdx" + "web/**/*.mjs" + "web/**/*.scss" + "web/**/*.ts" + "web/**/*.tsx" + "web/**/*.vue" + "web/**/*.yaml" + "web/**/*.yml" + ]; + }; }; }; -- 2.51.2