mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-21 20:11:06 +00:00
fix(oxc): prefer top-level oxlint root_dir in monorepos
This commit is contained in:
parent
cdc47ae615
commit
d840410047
1 changed files with 9 additions and 0 deletions
|
|
@ -30,6 +30,15 @@ return {
|
||||||
servers = {
|
servers = {
|
||||||
---@type lspconfig.settings.oxlint
|
---@type lspconfig.settings.oxlint
|
||||||
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 = {
|
settings = {
|
||||||
fixKind = "all",
|
fixKind = "all",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue