diff options
author | Andrew Kogut <mail@andykog.com> | 2024-02-03 01:02:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-02 16:02:13 -0800 |
commit | 5a71b6064ec6ecf0fff91af67e95200aae9e9562 (patch) | |
tree | 7b90da7ecf99f4f6c70a8a5f7706226c9381ba96 /lua/conform/formatters | |
parent | 4a5cb2e56a736b828c7f4d72961a0a419ad36dfd (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`
Diffstat (limited to 'lua/conform/formatters')
-rw-r--r-- | lua/conform/formatters/biome-check.lua | 14 |
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", + }), +} |