From a76a5e092a16169d290ab2845ae5872d6c555bab Mon Sep 17 00:00:00 2001 From: pyrho Date: Tue, 3 Oct 2023 22:08:33 +0000 Subject: [PATCH] feat: add ts-standard --- README.md | 1 + doc/conform.txt | 2 ++ lua/conform/formatters/ts-standard.lua | 12 ++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 lua/conform/formatters/ts-standard.lua diff --git a/README.md b/README.md index 6b317408..827b68fc 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,7 @@ To view configured and available formatters, as well as to see the log file, run - [terraform_fmt](https://www.terraform.io/docs/cli/commands/fmt.html) - The terraform-fmt command rewrites `terraform` configuration files to a canonical format and style. - [trim_newlines](https://www.gnu.org/software/gawk/manual/gawk.html) - Trim new lines with awk - [trim_whitespace](https://www.gnu.org/software/gawk/manual/gawk.html) - Trim whitespaces with awk +- [ts-standard](https://www.npmjs.com/package/ts-standard) - TypeScript Style Guide, with linter and automatic code fixer based on StandardJS - [uncrustify](https://github.com/uncrustify/uncrustify) - A source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and Vala. - [xmlformat](https://github.com/pamoller/xmlformatter) - xmlformatter is an Open Source Python package, which provides formatting of XML documents. - [yamlfix](https://github.com/lyz-code/yamlfix) - A configurable YAML formatter that keeps comments. diff --git a/doc/conform.txt b/doc/conform.txt index 98dafe66..a4be50b0 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -255,6 +255,8 @@ FORMATTERS *conform-formatter files to a canonical format and style. `trim_newlines` - Trim new lines with awk `trim_whitespace` - Trim whitespaces with awk +`ts-standard` - TypeScript Style Guide, with linter and automatic code fixer + based on StandardJS `uncrustify` - A source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and Vala. `xmlformat` - xmlformatter is an Open Source Python package, which provides diff --git a/lua/conform/formatters/ts-standard.lua b/lua/conform/formatters/ts-standard.lua new file mode 100644 index 00000000..6c6d922b --- /dev/null +++ b/lua/conform/formatters/ts-standard.lua @@ -0,0 +1,12 @@ +local util = require("conform.util") + +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://www.npmjs.com/package/ts-standard", + description = "TypeScript Style Guide, with linter and automatic code fixer based on StandardJS", + }, + command = util.from_node_modules("ts-standard"), + args = { "--fix", "--stdin", "$FILENAME" }, +} +