🐛 fix(nvim): correctly use biome json file

This commit is contained in:
Sergio Laín 2024-01-12 14:03:49 +01:00
parent f749811f40
commit ed23eae439
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
2 changed files with 2 additions and 3 deletions

View file

@ -20,8 +20,6 @@ return {
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
opts = function(_, opts) opts = function(_, opts)
--- Extend the conform plugin config and add given formatters
---@param tbl table<string, conform.FormatterUnit[]> Table of filetype to formatters mappings
local function add_formatters(tbl) local function add_formatters(tbl)
for ft, formatters in pairs(tbl) do for ft, formatters in pairs(tbl) do
if opts.formatters_by_ft[ft] == nil then if opts.formatters_by_ft[ft] == nil then
@ -42,6 +40,7 @@ return {
}) })
opts.formatters = { opts.formatters = {
cwd = require("conform.util").root_file({ "biome.json" }),
biome = { biome = {
condition = function(self, ctx) condition = function(self, ctx)
return vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1] return vim.fs.find({ "biome.json" }, { path = ctx.filename, upward = true })[1]

View file

@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json", "$schema": "https://biomejs.dev/schemas/1.5.1/schema.json",
"organizeImports": { "organizeImports": {
"enabled": true "enabled": true
}, },