Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Add support for ts-standard #1033

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions lua/null-ls/builtins/formatting/tsstandard.lua
Original file line number Diff line number Diff line change
@@ -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,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is working, in the repo I'm testing with, I'm using yarn and it doesn't seem to be running 🤔

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try enabling debug mode and see if there's anything there. It should give you an idea of how it's resolving the command in your project.

},
factory = h.formatter_factory,
})