Skip to content

Commit

Permalink
feat: add biome-check formatter
Browse files Browse the repository at this point in the history
`biome` formatter uses `biome format` command which applies formatting but doesn't apply lint autofixes.
Couldn't find a better way then to create another formatter that uses `biome check", --apply-unsafe`
  • Loading branch information
andykog committed Feb 1, 2024
1 parent 4588008 commit 6091a08
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lua/conform/formatters/biome-check.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
biomelint = {
meta = {
url = "https://github.com/biomejs/biome",
description = "A toolchain for web projects, aimed to provide functionalities to maintain them.",
},
command = util.from_node_modules("biome"),
stdin = true,
args = { "check", "--apply-unsafe", "--stdin-file-path", "$FILENAME" },
cwd = util.root_file({
"biome.json",
}),
}
}

0 comments on commit 6091a08

Please sign in to comment.