Skip to content

A very simple tool to run the svelte-check tool and pipe the results into neovims quick fix interface.

License

Notifications You must be signed in to change notification settings

nvim-svelte/nvim-svelte-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-svelte-check

A Neovim plugin that runs svelte-check asynchronously, displays a spinner while running, and populates the quickfix list with the results.

2025-03-10.13-48-26.mp4

Inspired by dmmulroy/tsc.nvim

⚠️ Important: Module Renamed in v2.0.0

The module has been renamed from sveltecheck to svelte-check. See the Migration Guide for details.

Installation

Using lazy.nvim

  1. Ensure lazy.nvim is set up in your Neovim configuration.
  2. Add the plugin to your plugin list:
-- lazy.nvim plugin configuration
require('lazy').setup({
    {
        'nvim-svelte/nvim-svelte-check',
        config = function()
            require('svelte-check').setup({
                command = "pnpm run check", -- Default command for pnpm
            })
        end,
    },
})

Using packer.nvim

  1. Ensure packer.nvim is set up in your Neovim configuration.
  2. Add the plugin to your plugin list:
-- packer.nvim plugin configuration
return require('packer').startup(function(use)
    use {
        'nvim-svelte/nvim-svelte-check',
        config = function()
            require('svelte-check').setup({
                command = "pnpm run check", -- Default command for pnpm
            })
        end
    }

    -- Add other plugins as needed
end)

Usage

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.

Customization

Customize the plugin by passing configuration options to the setup function:

  • command (string): The command to run svelte-check (default: "pnpm run check").
  • spinner_frames (table): Frames for the spinner animation (default: { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" })
  • debug_mode (boolean): Enable debug logging for troubleshooting (default: false)

Example Customization

require('svelte-check').setup({
    command = "npm run svelte-check", -- Custom command for npm, defaults to pnpm
    spinner_frames = { "", "", "", "", "", "", "", "" }, -- spinner frames
    debug_mode = false, -- will print debug messages if true (default is false)
})

Troubleshooting

If the plugin isn't correctly detecting errors or warnings:

  1. Try enabling debug mode to see detailed logging:

    require('svelte-check').setup({
        command = "npm run check",
        debug_mode = true
    })
  2. Verify that your project's svelte-check command works correctly in the terminal

  3. Make sure the command in your config matches the exact script name in package.json

  4. Check if your project uses a custom output format for svelte-check that might not be compatible with the plugin

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A very simple tool to run the svelte-check tool and pipe the results into neovims quick fix interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages