language/ts: add conform and lint rules for tsx

This commit is contained in:
Ching Pei Yang 2025-04-04 15:56:23 +02:00 committed by Ching Pei Yang
parent e2b3daa6f8
commit b7c08147e0

View file

@ -204,9 +204,13 @@ in {
(mkIf cfg.format.enable {
vim.formatter.conform-nvim = {
enable = true;
setupOpts.formatters_by_ft.typescript = [cfg.format.type];
setupOpts.formatters.${cfg.format.type} = {
command = getExe cfg.format.package;
setupOpts = {
formatters_by_ft.typescript = [cfg.format.type];
# .tsx files
formatters_by_ft.typescriptreact = [cfg.format.type];
formatters.${cfg.format.type} = {
command = getExe cfg.format.package;
};
};
};
})
@ -215,6 +219,7 @@ in {
vim.diagnostics.nvim-lint = {
enable = true;
linters_by_ft.typescript = cfg.extraDiagnostics.types;
linters_by_ft.typescriptreact = cfg.extraDiagnostics.types;
linters = mkMerge (map (name: {
${name}.cmd = getExe diagnosticsProviders.${name}.package;