svelte-check-rs Svelte Themes

Svelte Check Rs

Fast Rust-powered drop-in replacement for svelte-check (Svelte 5+)

svelte-check-rs

A high-performance, Rust-powered diagnostic engine designed as a drop-in replacement for svelte-check.

Note: This tool only supports Svelte 5+. For Svelte 4 or earlier, use the official svelte-check.

Features

  • šŸš€ Fast: 10-100x faster than svelte-check through Rust's zero-cost abstractions and parallel processing
  • āœ… Accurate: Matches svelte-check diagnostics, including Svelte compiler errors via bun
  • šŸ”„ Compatible: Drop-in CLI replacement, identical output formats
  • šŸ”§ Maintainable: Clean separation of concerns, comprehensive test suite

Installation

npm install -D svelte-check-rs

Postinstall downloads the binary. If lifecycle scripts are blocked, trust the package:

# pnpm
pnpm --config.ignore-scripts=false i -D svelte-check-rs

# bun
bun pm trust svelte-check-rs

Then add to your package.json scripts:

{
  "scripts": {
    "check": "svelte-check-rs"
  }
}

Or run directly with npx:

npx svelte-check-rs

macOS / Linux

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/pheuter/svelte-check-rs/releases/latest/download/svelte-check-rs-installer.sh | sh

Windows (PowerShell)

irm https://github.com/pheuter/svelte-check-rs/releases/latest/download/svelte-check-rs-installer.ps1 | iex

Usage

# Check current directory
svelte-check-rs

# Check specific directory
svelte-check-rs --workspace ./my-project

# Watch mode
svelte-check-rs --watch

# Different output formats
svelte-check-rs --output json
svelte-check-rs --output machine
svelte-check-rs --output human-verbose

CLI Options

Option Description
--workspace <PATH> Working directory (default: .)
--output <FORMAT> Output format: human, human-verbose, json, machine
--tsconfig <PATH> Path to tsconfig.json
--threshold <LEVEL> Minimum severity: error, warning
--watch Watch mode
--preserveWatchOutput Don't clear screen in watch mode
--fail-on-warnings Exit with error on warnings
--diagnostic-sources <LIST> Which diagnostics: js, svelte, css
--ignore <PATTERNS> Glob patterns to ignore
--no-cache Disable per-project cache + incremental builds (fresh run)
--disable-sveltekit-cache Disable cached .svelte-kit mirror
--skip-tsgo Skip TypeScript type-checking
--skip-svelte-compiler Skip Svelte compiler diagnostics
--tsgo-version Show installed tsgo version + path
--tsgo-update[=<VER>] Update tsgo to latest or specific version
--bun-version Show installed bun version + path
--bun-update[=<VER>] Update bun to latest or specific version
--debug-paths Show resolved binaries (tsgo, bun, svelte-kit)

Caching: By default, svelte-check-rs writes transformed files and tsgo incremental build info to node_modules/.cache/svelte-check-rs/. Use --no-cache for a fully fresh run (useful in CI).

Project Structure

crates/
ā”œā”€ā”€ svelte-parser/        # Lexer + parser + AST types
ā”œā”€ā”€ source-map/           # Position tracking and mapping
ā”œā”€ā”€ svelte-transformer/   # Svelte → TypeScript transformation
ā”œā”€ā”€ svelte-diagnostics/   # A11y, CSS, and component checks
ā”œā”€ā”€ tsgo-runner/          # tsgo process management
ā”œā”€ā”€ bun-runner/           # bun-managed Svelte compiler bridge
└── svelte-check-rs/      # CLI binary

Development

# Build all crates
cargo build

# Run tests
cargo test

# Run clippy
cargo clippy --all-targets -- -D warnings

# Format code
cargo fmt

License

MIT License - see LICENSE for details.

Top categories

Loading Svelte Themes