-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add eslint_d linter * Use eslint_d for source * Add to readme * Use GitHub URL for readme link. Co-authored-by: HyBer <[email protected]> * Add find to eslint_d * Add eslint_d to linter init * Add eslint * Add eslint to readme --------- Co-authored-by: HyBer <[email protected]>
- Loading branch information
Showing
4 changed files
with
70 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,33 @@ | ||
local lint = require('guard.lint') | ||
|
||
return { | ||
cmd = 'eslint', | ||
args = { '--format', 'json', '--stdin', '--stdin-filename' }, | ||
stdin = true, | ||
fname = true, | ||
find = { | ||
'.eslintrc.js', | ||
'.eslintrc.cjs', | ||
'.eslintrc.yaml', | ||
'.eslintrc.yml', | ||
'.eslintrc.json', | ||
}, | ||
parse = lint.from_json({ | ||
get_diagnostics = function(...) | ||
return vim.json.decode(...)[1].messages | ||
end, | ||
attributes = { | ||
lnum = 'line', | ||
end_lnum = 'endLine', | ||
col = 'column', | ||
end_col = 'endColumn', | ||
message = 'message', | ||
code = 'ruleId', | ||
}, | ||
severities = { | ||
lint.severities.warning, | ||
lint.severities.error, | ||
}, | ||
source = 'eslint', | ||
}), | ||
} |
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,33 @@ | ||
local lint = require('guard.lint') | ||
|
||
return { | ||
cmd = 'eslint_d', | ||
args = { '--format', 'json', '--stdin', '--stdin-filename' }, | ||
stdin = true, | ||
fname = true, | ||
find = { | ||
'.eslintrc.js', | ||
'.eslintrc.cjs', | ||
'.eslintrc.yaml', | ||
'.eslintrc.yml', | ||
'.eslintrc.json', | ||
}, | ||
parse = lint.from_json({ | ||
get_diagnostics = function(...) | ||
return vim.json.decode(...)[1].messages | ||
end, | ||
attributes = { | ||
lnum = 'line', | ||
end_lnum = 'endLine', | ||
col = 'column', | ||
end_col = 'endColumn', | ||
message = 'message', | ||
code = 'ruleId', | ||
}, | ||
severities = { | ||
lint.severities.warning, | ||
lint.severities.error, | ||
}, | ||
source = 'eslint_d', | ||
}), | ||
} |
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