feat(lsp): change from eslint/prettier to oxlint/oxfmt

This commit is contained in:
2026-03-06 05:47:45 +01:00
parent 4d22ec6939
commit f6a21cb88b
6 changed files with 21 additions and 44 deletions
-19
View File
@@ -1,19 +0,0 @@
local lsp = require("lsp")
---@type vim.lsp.Config
return {
on_attach = function(client, bufnr)
lsp.on_attach(client, bufnr)
vim.keymap.set("n", "<leader>lf", function()
vim.lsp.buf.format()
require("util").format({
buf = bufnr,
cmd = {
"prettier",
"--stdin-filepath",
"%file%",
},
})
end, { buffer = bufnr })
end,
}
+3
View File
@@ -0,0 +1,3 @@
---@type vim.lsp.Config
return {
}
+3
View File
@@ -0,0 +1,3 @@
---@type vim.lsp.Config
return {
}
+11 -23
View File
@@ -121,9 +121,6 @@ vim.api.nvim_create_autocmd("FileType", {
desc = "Use two space indent for C++ files", desc = "Use two space indent for C++ files",
pattern = { "cpp" }, pattern = { "cpp" },
callback = function() callback = function()
vim.bo.tabstop = 2
vim.bo.softtabstop = 2
vim.bo.shiftwidth = 2
vim.bo.cinoptions = "g0" vim.bo.cinoptions = "g0"
end, end,
}) })
@@ -178,15 +175,7 @@ vim.api.nvim_create_autocmd("FileType", {
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "xml", desc = "2-space indent",
callback = function()
vim.bo.tabstop = 2
vim.bo.softtabstop = 2
vim.bo.shiftwidth = 2
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { pattern = {
"json", "json",
"jsonc", "jsonc",
@@ -195,17 +184,16 @@ vim.api.nvim_create_autocmd("FileType", {
"css", "css",
"scss", "scss",
"less", "less",
"typescript",
"typescriptreact",
"javascript",
"javascriptreact",
"xml",
"cpp",
}, },
callback = function(ev) callback = function()
vim.keymap.set("n", "<leader>lf", function() vim.bo.tabstop = 2
require("util").format({ vim.bo.softtabstop = 2
buf = ev.buf, vim.bo.shiftwidth = 2
cmd = {
"prettier",
"--stdin-filepath",
"%file%",
},
})
end, { buffer = ev.buf })
end, end,
}) })
+2 -1
View File
@@ -73,7 +73,6 @@ function M.setup()
"bashls", "bashls",
"clangd", "clangd",
"cmake", "cmake",
"eslint",
"gopls", "gopls",
-- "hyprls", -- "hyprls",
"intelephense", "intelephense",
@@ -82,6 +81,8 @@ function M.setup()
-- "xml_ls", -- "xml_ls",
"lua_ls", "lua_ls",
"mesonlsp", "mesonlsp",
"oxfmt",
"oxlint",
-- "phpactor", -- "phpactor",
-- "pyrefly", -- "pyrefly",
"pyright", "pyright",
+2 -1
View File
@@ -16,7 +16,6 @@ return {
"cmake-language-server", "cmake-language-server",
dependencies = { "golines" }, dependencies = { "golines" },
}, },
"eslint-lsp",
"gopls", "gopls",
"hyprls", "hyprls",
{ {
@@ -33,6 +32,8 @@ return {
dependencies = { "stylua" }, dependencies = { "stylua" },
}, },
"mesonlsp", "mesonlsp",
"oxfmt",
"oxlint",
"ruff", "ruff",
"pyright", "pyright",
"pyrefly", "pyrefly",