From 580ab1880e740f4aebbc72a05350461f3cdef53d Mon Sep 17 00:00:00 2001 From: pseudometa <73286100+chrisgrieser@users.noreply.github.com> Date: Thu, 14 Sep 2023 20:44:32 +0200 Subject: feat: add `markdownlint`, `stylelint`, `codespell`, and `biome` (#45) * feat: add markdownlint, stylelint & codespell * feat: add `biome` * fix: indentation --- lua/conform/formatters/biome.lua | 10 ++++++++++ lua/conform/formatters/codespell.lua | 14 ++++++++++++++ lua/conform/formatters/markdownlint.lua | 10 ++++++++++ lua/conform/formatters/stylelint.lua | 10 ++++++++++ 4 files changed, 44 insertions(+) create mode 100644 lua/conform/formatters/biome.lua create mode 100644 lua/conform/formatters/codespell.lua create mode 100644 lua/conform/formatters/markdownlint.lua create mode 100644 lua/conform/formatters/stylelint.lua (limited to 'lua/conform') diff --git a/lua/conform/formatters/biome.lua b/lua/conform/formatters/biome.lua new file mode 100644 index 0000000..f6d6ae8 --- /dev/null +++ b/lua/conform/formatters/biome.lua @@ -0,0 +1,10 @@ +---@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 = "biome", + stdin = true, + args = { "format", "--stdin-file-path", "$FILENAME" }, +} diff --git a/lua/conform/formatters/codespell.lua b/lua/conform/formatters/codespell.lua new file mode 100644 index 0000000..ca07415 --- /dev/null +++ b/lua/conform/formatters/codespell.lua @@ -0,0 +1,14 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/codespell-project/codespell", + description = "Check code for common misspellings.", + }, + command = "codespell", + stdin = false, + args = { + "$FILENAME", + "--write-changes", + "--check-hidden", -- conform's temp file is hidden + }, +} diff --git a/lua/conform/formatters/markdownlint.lua b/lua/conform/formatters/markdownlint.lua new file mode 100644 index 0000000..654a603 --- /dev/null +++ b/lua/conform/formatters/markdownlint.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/DavidAnson/markdownlint", + description = "A Node.js style checker and lint tool for Markdown/CommonMark files.", + }, + command = "markdownlint", + args = { "--fix", "$FILENAME" }, + stdin = false, +} diff --git a/lua/conform/formatters/stylelint.lua b/lua/conform/formatters/stylelint.lua new file mode 100644 index 0000000..3d8361d --- /dev/null +++ b/lua/conform/formatters/stylelint.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/stylelint/stylelint", + description = "A mighty CSS linter that helps you avoid errors and enforce conventions.", + }, + command = "stylelint", + args = { "--stdin", "--fix" }, + stdin = true, +} -- cgit v1.2.3-70-g09d2