feat(vim): override the cspell linter for better integration
This will now use a custom config file `$HOME/.cspell.json` that will use a custom dictionary for my own words. This will have things like my name so cspell stop telling me I spelt my name wrong. Will also add the `--language-id` flag with the current filetype, so it can match language specific words.
This commit is contained in:
parent
0506dd4842
commit
e93f9864b5
1 changed files with 24 additions and 0 deletions
|
|
@ -37,6 +37,30 @@ lint.linters.psalm = {
|
|||
end
|
||||
}
|
||||
|
||||
lint.linters.cspell = {
|
||||
cmd = "cspell",
|
||||
stdin = true,
|
||||
args = {
|
||||
"lint",
|
||||
"--no-color",
|
||||
"--no-progress",
|
||||
"--no-summary",
|
||||
"--config=" .. os.getenv("HOME") .. "/.cspell.json",
|
||||
function()
|
||||
local file_type = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
return "--language-id=" .. file_type
|
||||
end,
|
||||
"--",
|
||||
"stdin",
|
||||
},
|
||||
stream = "stdout",
|
||||
parser = require("lint.parser").from_errorformat("/:%l:%c - %m", {
|
||||
source = "cspell",
|
||||
severity = vim.diagnostic.severity.INFO,
|
||||
}),
|
||||
}
|
||||
|
||||
|
||||
lint.linters_by_ft = {
|
||||
php = {'phpcs'},
|
||||
typescript = {'eslint'},
|
||||
|
|
|
|||
Loading…
Reference in a new issue