Skip to content

Commit

Permalink
feat: add biome-check formatter (#287)
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 authored Feb 3, 2024
1 parent 4a5cb2e commit 5a71b60
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lua/conform/formatters/biome-check.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
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 5a71b60

Please sign in to comment.