A Neovim plugin that runs svelte-check
asynchronously, displays a spinner while running, and populates the quickfix list with the results.
https://github.com/StephenGunn/sveltecheck.nvim/assets/7240548/99c3549e-2c54-4c1a-ab70-16d463e3e4ad
Inspired by dmmulroy/tsc.nvim
lazy.nvim
lazy.nvim
is set up in your Neovim configuration.-- lazy.nvim plugin configuration
require('lazy').setup({
{
'StephenGunn/sveltecheck.nvim',
config = function()
require('sveltecheck').setup({
command = "pnpm run check", -- Default command for pnpm
})
end,
},
})
packer.nvim
packer.nvim
is set up in your Neovim configuration.-- packer.nvim plugin configuration
return require('packer').startup(function(use)
use {
'StephenGunn/sveltecheck.nvim',
config = function()
require('sveltecheck').setup({
command = "pnpm run check", -- Default command for pnpm
})
end
}
-- Add other plugins as needed
end)
After installation, run the svelte-check
command in Neovim:
:SvelteCheck
This command will start the svelte-check
process, display a spinner, and populate the quickfix list with any errors or warnings found. A summary of the check will be printed upon completion.
Customize the plugin by passing configuration options to the setup
function. The available option is:
command
(string): The command to run svelte-check
(default: "pnpm run check"
).require('svelte-check').setup({
command = "npm run svelte-check", -- Custom command for npm, defaults to pnpm
spinner_frames = { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }, -- default spinner frames
debug_mode = false, -- will print debug messages if true (fault is false)
})
lazy.nvim
and packer.nvim
lazy.nvim
Customization Example:
require('lazy').setup({
{
'StephenGunn/sveltecheck.nvim',
config = function()
require('sveltecheck').setup({
command = "npm run svelte-check",
})
end,
},
})
packer.nvim
Customization Example:
return require('packer').startup(function(use)
use {
'StephenGunn/sveltecheck.nvim',
config = function()
require('sveltecheck').setup({
command = "npm run svelte-check",
})
end
}
-- Add other plugins as needed
end)