From 8cda01b8855f4fce2f35a9027e81f57e94ccbd12 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 11 Jul 2023 22:54:22 +0300 Subject: [PATCH] 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 c1e548c..801f7f8 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 3989b47..8c2efe2 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