summaryrefslogtreecommitdiff
path: root/treefmt.nix
blob: b0cf63e7521626fab9ebd3acc676d50dc6334b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ pkgs, ... }:
let
  dprintPlugins = pkgs.callPackage ./dprintPlugins { };
in
{
  projectRootFile = ".git/config";

  programs = {
    dprint = {
      enable = true;

      settings = {
        useTabs = true;

        plugins = map toString [
          dprintPlugins.json
          dprintPlugins.markdown
          dprintPlugins.typescript
          dprintPlugins."g-plane/malva"
          dprintPlugins."g-plane/markup_fmt"
        ];

        includes = [ "**/*.{css,json,md,ts,tsx}" ];

        json = {
          deno = true;
        };

        markdown = { };

        typescript = {
          deno = true;
        };

        malva = { };
        markup = { };
      };
    };

    deadnix.enable = true;
    nixfmt.enable = true;
    statix.enable = true;
  };
}