From ed85611e1ffac646682653af4e04a512f117750e Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 17 Oct 2024 01:10:32 -0700 Subject: [PATCH] fix: setup typescript tools and react formatting properly --- lua/plugins/conform.lua | 3 ++- lua/plugins/lz-spec.lua | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 7c829fd..15b1a05 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -54,13 +54,14 @@ return { rust = { "rustfmt" }, javascript = { "prettierd", "prettier", stop_after_first = true }, typescript = { "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "prettierd", "prettier", stop_after_first = true }, + jypescriptreact = { "prettierd", "prettier", stop_after_first = true }, nix = { "nixfmt" }, haskell = { "fourmolu", "ormolu", stop_after_first = true }, json = { "prettierd", "prettier", stop_after_first = true }, toml = { "taplo", stop_after_first = true }, yaml = { "prettierd", "prettier", stop_after_first = true }, typst = { "typstyle" }, - tsx = { "prettier" }, svelte = { "prettier" }, }, }) diff --git a/lua/plugins/lz-spec.lua b/lua/plugins/lz-spec.lua index ac8bc71..d2e367f 100644 --- a/lua/plugins/lz-spec.lua +++ b/lua/plugins/lz-spec.lua @@ -238,7 +238,13 @@ return { }, { "rustaceanvim" }, { "haskell-tools.nvim" }, - { "typescript-tools.nvim" }, + { + "typescript-tools.nvim", + filetypes = { "typescriptreact", "typescript", "javascript", "svelte", "javascriptreact" }, + after = function() + require("typescript-tools").setup() + end, + }, { "lsp_lines.nvim", event = "LspAttach",