From 0b46f64a48224da45465cb48486b9c98f5435836 Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Mon, 22 Aug 2022 11:01:09 +0100 Subject: [PATCH] Add support for ts-standard --- .../builtins/formatting/tsstandard.lua | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lua/null-ls/builtins/formatting/tsstandard.lua diff --git a/lua/null-ls/builtins/formatting/tsstandard.lua b/lua/null-ls/builtins/formatting/tsstandard.lua new file mode 100644 index 000000000..41e9df53e --- /dev/null +++ b/lua/null-ls/builtins/formatting/tsstandard.lua @@ -0,0 +1,22 @@ +local h = require("null-ls.helpers") +local cmd_resolver = require("null-ls.helpers.command_resolver") +local methods = require("null-ls.methods") + +local FORMATTING = methods.internal.FORMATTING + +return h.make_builtin({ + name = "ts-standard", + meta = { + url = "https://github.com/standard/ts-standard", + description = "Typescript style guide, linter, and formatter using StandardJS", + }, + method = FORMATTING, + filetypes = { "typescript", "typescriptreact" }, + generator_opts = { + command = "ts-standard", + args = { "--stdin", "--fix" }, + to_stdin = true, + dynamic_command = cmd_resolver.from_node_modules, + }, + factory = h.formatter_factory, +})