fix(oxc): prefer top-level oxlint root_dir in monorepos

This commit is contained in:
Folke Lemaitre 2026-04-26 20:15:56 +02:00
parent cdc47ae615
commit d840410047
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -30,6 +30,15 @@ return {
servers = {
---@type lspconfig.settings.oxlint
oxlint = {
root_dir = function(bufnr, on_dir)
-- prefer the top-level oxlint config if it exists (monorepo support)
local git = vim.fs.root(bufnr, ".git")
local markers = { ".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts" }
local root = git and vim.fs.root(git, markers) or vim.fs.root(bufnr, markers)
if root then
on_dir(root)
end
end,
settings = {
fixKind = "all",
},