hyperhive/nix/treefmt.nix
atlas 5d24bedd60 treefmt: format the web files with prettier
`nix/treefmt.nix` gated nix, rust and toml and nothing else, so markdown,
css, js/ts/tsx, html and json had no formatting gate at all. Operator
asked for "the web stuff to be formatted as well" (#1997).

This commit is the one-line enable; the reformat it produces is the
commit after it, kept separate so this one stays reviewable.

Scope is treefmt-nix's `programs.prettier` default rather than a
hand-written `includes` list. The default is wider than the requested
md/css/js/ts/tsx/html/json — it also covers yaml, scss, vue, mdx, json5,
cjs/mjs/jsx — but measured against this tree that width costs exactly 3
extra files, all `frontend/packages/*/build.mjs`, which are web build
scripts. `.forgejo/workflows/{ci,coverage}.yml` are in the default set
and already conform, so they reformat to nothing today; from here on they
are gated too, which is what a repo formatter is for.

`.prettierignore` is honoured: prettier applies it even to the explicit
paths treefmt passes, so the `hivectl markdown-docs` generated file and
the 12 files awaiting manual list-item re-wrap stay untouched.
2026-09-02 15:25:07 +02:00

12 lines
306 B
Nix

# treefmt-nix module — shared by `nix fmt` (the flake `formatter`
# output) and the `formatting` flake check.
{
projectRootFile = "flake.nix";
programs = {
keep-sorted.enable = true;
nixfmt.enable = true;
prettier.enable = true;
rustfmt.enable = true;
taplo.enable = true;
};
}