-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mathias Fussenegger <[email protected]>
- Loading branch information
1 parent
6742c6e
commit 9195dd0
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
local binary_name = "ts-standard" | ||
local pattern = "[^:]+:(%d+):(%d+):([^%.]+%.?)%s%(([%a-]+)%)%s?%(?(%a*)%)?" | ||
local groups = { "lnum", "col", "message", "code", "severity" } | ||
local severities = { | ||
[""] = vim.diagnostic.severity.ERROR, | ||
["warning"] = vim.diagnostic.severity.WARN, | ||
} | ||
|
||
return { | ||
cmd = function() | ||
local local_binary = vim.fn.fnamemodify("./node_modules/.bin/" .. binary_name, ":p") | ||
return vim.loop.fs_stat(local_binary) and local_binary or binary_name | ||
end, | ||
stdin = true, | ||
args = { "--stdin" }, | ||
ignore_exitcode = true, | ||
parser = require("lint.parser").from_pattern(pattern, groups, severities, { ["source"] = "ts-standard" }, {}), | ||
} |