aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Kogut <mail@andykog.com>2024-02-03 01:02:13 +0100
committerGitHub <noreply@github.com>2024-02-02 16:02:13 -0800
commit5a71b6064ec6ecf0fff91af67e95200aae9e9562 (patch)
tree7b90da7ecf99f4f6c70a8a5f7706226c9381ba96
parent4a5cb2e56a736b828c7f4d72961a0a419ad36dfd (diff)
feat: add biome-check formatter (#287)
`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`
-rw-r--r--lua/conform/formatters/biome-check.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/conform/formatters/biome-check.lua b/lua/conform/formatters/biome-check.lua
new file mode 100644
index 0000000..1ac99e3
--- /dev/null
+++ b/lua/conform/formatters/biome-check.lua
@@ -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",
+ }),
+}