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

svelte-check-native

v0.8.2

Published

Fast CLI type-checker for Svelte 4 and Svelte 5 projects. Drop-in replacement for svelte-check, written in Rust, powered by tsgo.

Readme

version downloads

Blazing fast CLI type-checker for Svelte projects. Drop-in replacement for svelte-check — compatible flags, byte-identical diagnostics, same exit codes. Single Rust binary, powered by tsgo, incremental via tsbuildinfo. Built for AI agents, CI/CD, and pre-commit hooks that actually stay enabled.

Not an LSP, CSS linter, or formatter.

Speed

Measured on a SvelteKit + TypeScript monorepo with 1359 .svelte files (Svelte 5 runes), M1 Pro 8C, mean of 2 runs each:

svelte-check-native --tsconfig tsconfig.json --diagnostic-sources 'ts,svelte'

  tool                  cold     warm     dirty   speedup   errors/warnings/problems
──────────────────────────────────────────────────────────────────────────────────────
svelte-check-native      1.8s     1.0s     0.9s      41x           0/49/17
svelte-check            40.0s    41.0s    41.6s     1.0x           0/49/17
svelte-check --tsgo     18.3s    18.6s    17.9s     2.9x           1/49/18
svelte-check-rs         12.2s     5.5      4.4s     7.5x         732/44/261

Diagnostic counts match svelte-check with same flags.

Install

npm i -D svelte-check-native @typescript/native-preview

@typescript/native-preview is the tsgo binary — required at check time, never imported at runtime.

Use

npx svelte-check-native --workspace .

Or add it to package.json:

{
  "scripts": {
    "check": "svelte-check-native --workspace ."
  }
}

Same flags as svelte-check. See npx svelte-check-native --help.

How it works

Single Rust binary. Each .svelte file flows through a handful of crates in one process:

| Crate | What it does | | ----------------- | ----------------------------------------------------------------------------------------------- | | parser | Parses .svelte source into a Svelte-5 AST (script + template). | | analyze | Builds a SemanticModel — runes, prop shapes, bindings, scope — used by emit and lint. | | emit | Generates the .svelte.ts overlay tsgo will type-check. Imports rewritten so tsgo lands on it. | | svn-lint | Native Rust port of svelte/compiler's warning pass. Covers all known codes; no subprocess. | | svelte-compiler | Fallback bridge to the user's svelte/compiler over a persistent bun/node worker pool. | | typecheck | Owns the tsgo overlay tsconfig + the tsbuildinfo cache; invokes tsgo; maps diagnostics back. | | core | Shared types (spans, diagnostics, position maps) + the canonical TsConfig struct. | | cli | Entrypoint. Flag parsing, file discovery, output formatting, exit codes. |

Flags

Every flag not listed below behaves the same as svelte-check.

New flags

--svelte-warnings <mode>      How to source Svelte compiler warnings:
                              native | bridge
                              native: rust port faster
                              bridge: js bridge same as svelte-check, slower by 1.5-2s
--timings                     Phase-by-phase wall-clock breakdown
--debug-paths                 Print resolved binaries, exit
--tsgo-version                Print tsgo version, exit
--tsgo-diagnostics            Print tsgo's perf/memory stats after the run
--emit-ts                     Print generated TypeScript per file, exit

Not supported

  • --watch / --preserveWatchOutput — use watchexec or your editor's file watcher externally.
  • --no-tsconfig — errors out. A tsconfig is required.
  • --incremental — always on. tsgo's tsbuildinfo handles it.
  • --tsgo — always on. Classic tsc is not wired up.
  • --diagnostic-sources css — accepted but no-op (a CSS language service isn't bundled). Roadmap below.

Run svelte-check-native --help for the full list.

Output defaults to machine when run from a coding-agent CLI: CLAUDECODE=1 (Claude Code), GEMINI_CLI=1 (Gemini CLI), or CODEX_CI=1 (OpenAI Codex CLI).

Environment variables

  • TSGO_BIN — override tsgo discovery; accepts an absolute path to a platform-native tsgo binary. Useful when @typescript/native-preview isn't in node_modules (e.g. a monorepo where tsgo lives elsewhere).
  • SVN_BRIDGE_WORKERS — number of svelte/compiler worker subprocesses. Default cores/2, capped at 8; tracks the perf-core count on Apple Silicon. Override if you hit IPC contention on very large core counts.
  • CLAUDECODE / GEMINI_CLI / CODEX_CI — any set forces machine output for agent-friendly parsing.

Exit codes

  • 0 — no errors (and no warnings if --fail-on-warnings)
  • 1 — errors detected (or warnings with --fail-on-warnings)
  • 2 — invocation error (bad flag, missing tsconfig, tsgo not found)

Roadmap

  • [ ] CSS lint diagnostics

Troubleshooting

Stale errors after editing tsconfig.json or path aliases — wipe the cache: rm -rf node_modules/.cache/svelte-check-native and re-run. The overlay config is regenerated from your live tsconfig on every run, but tsgo's tsbuildinfo can hold onto stale resolution state.

TS2321 "Excessive stack depth" on your own types — usually a UnionToRecord<T> that round-trips through UnionToTuple<T>[number]. Iterate T directly in the mapped-type key instead.

Prior art

  • svelte2tsx / svelte-check — transpiler + CLI whose output shape and flags we match. The .v5 fixture corpus from svelte2tsx is our parity gate.
  • tsgo — the Go-based TypeScript compiler that does the actual type-checking. Shipped as @typescript/native-preview.

License

MIT