npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rsvelte/svelte-check

v0.5.28

Published

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

Readme

@rsvelte/svelte-check

A Rust-powered drop-in replacement for svelte-check. Type-checks .svelte, .svelte.ts / .svelte.js, and the surrounding .ts / .js files in a Svelte project, and reports compiler warnings, A11y warnings, CSS warnings, and TypeScript diagnostics from a single CLI.

⚠️ Early stage. Output and flags are stabilising. Not yet recommended for production CI gates without a fallback to the official svelte-check.

Install

npm install -D @rsvelte/svelte-check
# pnpm add -D @rsvelte/svelte-check
# yarn add -D @rsvelte/svelte-check

The package ships a small loader that resolves the right prebuilt native binary for your platform via optionalDependencies. Supported targets:

| OS | Architecture | |---|---| | macOS | arm64, x64 | | Linux | x64 (glibc ≥ 2.35), arm64 (glibc ≥ 2.35) | | Windows | x64 (MSVC) |

If your platform isn't listed, please open an issue.

Usage

From your project root:

# Svelte + TypeScript diagnostics (uses the workspace's own tsc)
npx rsvelte-check

# Type-check with the TypeScript 7 native compiler instead.
# Requires TypeScript 7 in the workspace:
#   npm install --save-dev typescript@~6 @typescript/native@npm:typescript@7
npx rsvelte-check --tsgo

# Compiler + A11y + CSS diagnostics only (fast — no TypeScript)
npx rsvelte-check --no-type-check

# Watch mode with incremental cache
npx rsvelte-check --watch --incremental

Add it to your package.json:

{
  "scripts": {
    "check": "rsvelte-check --tsgo",
    "check:watch": "rsvelte-check --tsgo --watch --incremental"
  }
}

CLI flags

| Flag | Description | |---|---| | --workspace <dir> | Project root to scan. Defaults to the current directory. | | --output <format> | human, human-verbose (default), machine, machine-verbose, or github-actions. | | --ignore <list> | Comma-separated path components to skip while walking the workspace. | | --fail-on-warnings | Exit non-zero when any warning is reported (default: errors only). | | --tsgo | Type-check with the TypeScript 7 native compiler (@typescript/native, else @typescript/native-preview) instead of the workspace's own tsc. Errors when TypeScript 7 is not installed. | | --no-type-check | Skip TypeScript entirely — Svelte compiler / A11y / CSS diagnostics only. | | --tsconfig <path> | Base tsconfig.json for the overlay to extends. | | --no-tsconfig | Ignore any project tsconfig/jsconfig (no --tsconfig extends, no discovery) — check only the Svelte files. | | --config <path> | Use a non-standard svelte.config.* / vite.config.* path for the diagnostic-relevant compilerOptions (and kit.files) instead of discovering one under the workspace. | | --emit-overlay | Materialise .tsx shadow files + an overlay tsconfig under <workspace>/.svelte-check/ without running a type-checker. Useful for inspecting what gets handed to TS. | | --compiler-warnings <list> | Per-code overrides, e.g. --compiler-warnings css-unused-selector:ignore,a11y-no-noninteractive-element-to-interactive-role:error. | | --diagnostic-sources <list> | Restrict output to any subset of svelte, ts / js, css. | | --threshold <level> | Filter the diagnostics that are printed: error shows only errors, warning (default) shows warnings and errors. Counts and exit code are unaffected. | | --incremental | Reuse <workspace>/.svelte-check/manifest.json between runs — unchanged files skip the overlay regeneration step. | | --watch | Stay alive and re-check on file changes. Composes with --incremental. | | --preserveWatchOutput | In watch mode, don't clear the terminal between runs. (--preserve-watch-output is accepted as an alias.) |

Upstream flag compatibility

rsvelte-check accepts every flag the official svelte-check CLI exposes. Names match upstream, with two exceptions noted below.

| Upstream flag | rsvelte-check | Notes | |---|---|---| | --workspace | ✅ | | | --output | ✅ | Plus the rsvelte-only github-actions format. | | --watch | ✅ | | | --preserveWatchOutput | ✅ | Canonical name; --preserve-watch-output kept as an alias. | | --incremental | ✅ | | | --tsgo | ✅ | | | --tsgo-experimental-api | ✅ (alias) | rsvelte has a single native tsgo backend, so this behaves exactly like --tsgo. | | --tsconfig | ✅ | | | --config | ✅ | Overrides the config source for the diagnostic-relevant compilerOptions / kit.files. | | --no-tsconfig | ✅ | | | --ignore | ✅ | Always active as a walker skip-list (rsvelte does not gate it behind --no-tsconfig). | | --fail-on-warnings | ✅ | | | --compiler-warnings | ✅ | | | --diagnostic-sources | ✅ | | | --threshold | ✅ | | | --color / --no-color | ✅ (no-op) | Accepted for compatibility; rsvelte-check output is not colorized. |

Run rsvelte-check --help for the authoritative list.

How it works

rsvelte-check walks your project, parses every .svelte file with the rsvelte compiler, and reports compiler / A11y / CSS warnings directly. For TypeScript diagnostics, it generates .tsx shadow files (via @rsvelte/svelte2tsx) plus an overlay tsconfig.json under .svelte-check/, then hands the overlay to tsc (or tsgo with --tsgo). Diagnostics are remapped back onto the original .svelte source via high-resolution source maps so error positions point at the line and column you actually wrote.

Highlights:

  • SvelteKit-aware. Honours svelte.config.js's kit.files overrides; injects SvelteKit-generated kit-file augmentations for both .ts (real TS annotations) and .js (JSDoc) files.
  • warningFilter support. A function compilerOptions.warningFilter in svelte.config.js is honoured. The native compiler can't run the JS predicate itself, so the run's compiler warnings are collected and passed once to a small Node sidecar (bundled with this package) that imports your config and applies the function — equivalent to Svelte's emit-time filter since it's a pure per-warning predicate. If Node is unavailable or the config can't be imported, every warning is shown and a one-time note is printed (the filter never silently drops a warning). Projects without a function warningFilter pay nothing — the sidecar is never spawned.
  • Incremental. A per-file overlay manifest and a per-file warning cache (<cacheDir>/warnings.json) make warm runs near-instant.
  • Parallel compile. Files are compiled across rayon workers; the TS pass is the long pole.
  • Watch mode. Composes with --incremental for an editor-like inner loop.

Compatibility status

  • Compiler / A11y / CSS warnings — full coverage; matches the official svelte-check's set.
  • TypeScript diagnostics via tsgo — covered for the standard project shapes (plain Svelte 5, SvelteKit). Edge cases around custom preprocessors are still being shaken out.
  • LSP integration (editor hover / completion) — out of scope for this package. Wait on the upstream tsgo tsserver mode before assuming editor support.

If you hit a diagnostic the official svelte-check produces and this one doesn't (or vice-versa), please open an issue with a minimal repro.

Known limitations

  • Same-name Foo.svelte.ts / Foo.svelte.js companion next to Foo.svelte (#800). When a module file shares a component's base name, import … from './Foo.svelte' resolves to the companion instead of the component, so the component's default export and <script module> named exports are reported missing (has no default export, Circular definition of import alias, declares 'X' locally, but it is not exported). This is standard TypeScript relative-module resolution — tsc and tsgo behave identically — and the official svelte-check only avoids it via a TypeScript language-server plugin (resolveModuleNameLiterals) that the native tsgo binary does not support. Workaround: don't put a same-name companion next to a component — give shared module-context code a distinct name (e.g. foo-helpers.ts), or import the component's <script module> exports directly from ./Foo.svelte. The rsvelte_lint linter ships an opt-in svelte/no-companion-module-shadow rule (off by default) that flags this pattern so you catch it before it surprises you.

Performance

rsvelte-check is part of the rsvelte project. On a 500-file workspace the Svelte-side check runs ~71× faster multi-threaded than the official svelte-check (live benchmark). The TypeScript pass via tsc / tsgo dominates wall-clock time on most projects; the Svelte side rarely registers.

License

MIT