language/css: migrate to conform/nvim-lint

This commit is contained in:
Ching Pei Yang 2025-03-27 19:52:28 +01:00
parent e996999c0b
commit 459e97dab7
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -6,6 +6,7 @@
}: let
inherit (builtins) attrNames;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.lists) isList;
inherit (lib.types) enum either listOf package str;
@ -42,14 +43,6 @@
formats = {
prettier = {
package = pkgs.nodePackages.prettier;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier",
})
)
'';
};
prettierd = {
@ -132,8 +125,13 @@ in {
})
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig;
vim.formatter.conform-nvim = {
enable = true;
setupOpts.formatters_by_ft.css = [cfg.format.type];
setupOpts.formatters.${cfg.format.type} = {
command = getExe cfg.format.package;
};
};
})
]);
}