← 全部工具

@rsvelte/svelte-check

热度 65 更新于 开发与构建

Rust-powered svelte-check CLI — type-checks and diagnoses Svelte projects

npmauto-collected

安装

npm
npm install -g @rsvelte/svelte-check

通过 npm 安装。

<p align="center" <img src="assets/logo.png" alt="rsvelte" width="200" height="200" / </p

<h1 align="center"rsvelte</h1

<p align="center" <strongA Rust port of the official Svelte 5 compiler — and the ecosystem around it — built to slot natively into the <a href="https://oxc.rs/"OXC</a toolchain.</strong </p

<p align="center" <a href="https://baseballyama.github.io/rsvelte/"Website</a · <a href="https://baseballyama.github.io/rsvelte/playground"Playground</a · <a href="https://baseballyama.github.io/rsvelte/benchmark"Benchmarks</a · <a href="https://baseballyama.github.io/rsvelte/progress"Compatibility</a </p

<p align="center" <a href="https://app.codspeed.io/baseballyama/rsvelte?utmsource=badge"<img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="CodSpeed"/</a </p

⚠️ Early stage — rsvelte passes 100% of the in-scope fixtures in the official Svelte 5 test suite, but it's pre-1.0: APIs and behaviour may change without notice. Use in production at your own risk.

Why rsvelte exists

The native JS toolchain growing around OXC — oxlint, oxfmt, Rolldown, tsgo — can only see .js / .ts / .jsx / .tsx. .svelte files are invisible to it, because parsing Svelte means running the JavaScript-based Svelte compiler, which native tools can't link against. Svelte developers are locked out of the order-of-magnitude speed-ups the rest of the ecosystem is starting to take for granted.

rsvelte fixes that at the source: it ports the compiler — and the ecosystem hot paths around it (svelte2tsx, svelte-check, vite-plugin-svelte, formatting) — to Rust on top of OXC's parser, codegen, and semantic stack. The end goal is upstream integration, so oxlint can lint .svelte, oxfmt can format it, Rolldown can bundle it, and tsgo can type-check it — all without a JS compiler hop.

Until then, the @rsvelte/ packages let you use rsvelte today: the compiler, the Vite plugin, svelte-check, and svelte2tsx are drop-in replacements for their JS counterparts, verified byte-for-byte on every release. @rsvelte/fmt and @rsvelte/lint target output/behaviour parity as fast complements rather than configuration-compatible replacements, and @rsvelte/language-server currently covers formatting and lint diagnostics only — see Packages for what each one does and doesn't cover.

Quick start

Vite

The plugin is a fork of @sveltejs/vite-plugin-svelte with the same public API — only the compiler underneath changes.

npm install -D @rsvelte/vite-plugin-svelte
// vite.config.js
import { svelte } from '@rsvelte/vite-plugin-svelte';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [svelte()],
});

SvelteKit

SvelteKit pulls in @sveltejs/vite-plugin-svelte internally, so redirect it with a package-manager override — no config changes needed:

// package.json (pnpm; npm/yarn have equivalent overrides/resolutions fields)
{
  "pnpm": {
    "overrides": {
      "@sveltejs/vite-plugin-svelte": "npm:@rsvelte/vite-plugin-svelte@^0.4.0"
    }
  }
}