From 8cda01b8855f4fce2f35a9027e81f57e94ccbd12 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 11 Jul 2023 22:54:22 +0300 Subject: [PATCH 1/2] feat: add prettierd as an alternative to prettier --- docs/release-notes/rl-0.4.adoc | 2 ++ modules/languages/ts.nix | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/docs/release-notes/rl-0.4.adoc b/docs/release-notes/rl-0.4.adoc index c1e548c8..801f7f8a 100644 --- a/docs/release-notes/rl-0.4.adoc +++ b/docs/release-notes/rl-0.4.adoc @@ -62,5 +62,7 @@ https://github.com/notashelf[notashelf]: * Added a module for enabling Neovim's spellchecker +* Replaced prettier with prettierd - the daemonized version of prettier + * Cleaned up documentation diff --git a/modules/languages/ts.nix b/modules/languages/ts.nix index 3989b478..8c2efe29 100644 --- a/modules/languages/ts.nix +++ b/modules/languages/ts.nix @@ -36,6 +36,17 @@ with builtins; let ) ''; }; + prettierd = { + package = pkgs.prettierd; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.prettier.with({ + command = "${cfg.format.package}/bin/prettierd", + }) + ) + ''; + }; }; # TODO: specify packages From 24f6ed145e8fef5c1cab93b7b9db92c50ba5a754 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 11 Jul 2023 22:54:43 +0300 Subject: [PATCH 2/2] feat: default to prettierd over prettier --- modules/languages/ts.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/languages/ts.nix b/modules/languages/ts.nix index 8c2efe29..44fc7655 100644 --- a/modules/languages/ts.nix +++ b/modules/languages/ts.nix @@ -23,7 +23,7 @@ with builtins; let }; # TODO: specify packages - defaultFormat = "prettier"; + defaultFormat = "prettierd"; formats = { prettier = { package = pkgs.nodePackages.prettier;