{"_id":"@alasano/svelte-fast-check","_rev":"2-fcd5ce096ad80c7e3180db416f7b1d6b","name":"@alasano/svelte-fast-check","dist-tags":{"latest":"0.4.6-fork.2"},"versions":{"0.4.6-fork.1":{"name":"@alasano/svelte-fast-check","version":"0.4.6-fork.1","keywords":["svelte","sveltekit","typescript","type-checker","tsgo","typescript-go"],"author":{"name":"Aljosa Asanovic"},"license":"MIT","_id":"@alasano/svelte-fast-check@0.4.6-fork.1","maintainers":[{"name":"alasano","email":"aljosa.a@gmail.com"}],"contributors":[{"url":"https://github.com/astralhpi","name":"Song Jaehak","email":"astralhpi@gmail.com"}],"homepage":"https://github.com/alasano/svelte-fast-check#readme","bugs":{"url":"https://github.com/alasano/svelte-fast-check/issues"},"bin":{"svelte-fast-check":"dist/cli.js"},"dist":{"shasum":"e3dcc4dc5b94b6ed9a341269a655d5db70d99c9a","tarball":"https://registry.npmjs.org/@alasano/svelte-fast-check/-/svelte-fast-check-0.4.6-fork.1.tgz","fileCount":9,"integrity":"sha512-6mJQ68EJZ4h2j6+ygi4Xy+BUGsYpBVyffI9wC71UPpYBM2l4KK8VVWVdkKIHJgT1IKIzsMZ3HvaeBnQAZMSDkQ==","signatures":[{"sig":"MEUCIQDyq3Tti4uWo+EHfgatOldK5nJgDWP6cRR3iCVZYYGW4QIgXbau6hjYHz/0zkVQaYpSJrbqoizpwt0VvLABIoMNBHk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120014},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5862af79cad6768f8f3de8461f31ba45e485d0f3","scripts":{"lint":"biome check .","test":"bun test tests/","build":"tsup","format":"biome format --write .","prepare":"husky","lint:fix":"biome check --write .","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"alasano","email":"aljosa.a@gmail.com"},"repository":{"url":"git+https://github.com/alasano/svelte-fast-check.git","type":"git"},"workspaces":["tests/fixtures/*"],"_npmVersion":"10.2.3","description":"Up to 24x faster type and Svelte compiler warning checker for Svelte/SvelteKit projects using svelte2tsx + tsgo","directories":{},"lint-staged":{"*.{js,ts,json}":["biome check --write --no-errors-on-unmatched"]},"_nodeVersion":"22.22.0","dependencies":{"cleye":"^2.2.1","picomatch":"^4.0.3","svelte2tsx":"^0.7.34","tinyglobby":"^0.2.15","@jridgewell/trace-mapping":"^0.3.25","@typescript/native-preview":"^7.0.0-dev.20251229.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","husky":"^9.1.7","@types/bun":"^1.3.5","@types/node":"^22.0.0","lint-staged":"^16.2.7","@biomejs/biome":"^2.3.10","@types/picomatch":"^4.0.2"},"peerDependencies":{"svelte":">=5.0.0","typescript":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/svelte-fast-check_0.4.6-fork.1_1771611737192_0.37154981804152953","host":"s3://npm-registry-packages-npm-production"}},"0.4.6-fork.2":{"name":"@alasano/svelte-fast-check","version":"0.4.6-fork.2","description":"Up to 24x faster type and Svelte compiler warning checker for Svelte/SvelteKit projects using svelte2tsx + tsgo","type":"module","workspaces":["tests/fixtures/*"],"main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"svelte-fast-check":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup","test":"bun test tests/","lint":"biome check .","lint:fix":"biome check --write .","format":"biome format --write .","typecheck":"tsc --noEmit","prepare":"husky","prepublishOnly":"npm run build"},"lint-staged":{"*.{js,ts,json}":["biome check --write --no-errors-on-unmatched"]},"engines":{"node":">=22"},"dependencies":{"@jridgewell/trace-mapping":"^0.3.25","@typescript/native-preview":"^7.0.0-dev.20251229.1","cleye":"^2.2.1","picomatch":"^4.0.3","svelte2tsx":"^0.7.34","tinyglobby":"^0.2.15"},"peerDependencies":{"svelte":">=5.0.0","typescript":">=5.0.0"},"devDependencies":{"@biomejs/biome":"^2.3.10","@types/bun":"^1.3.5","@types/node":"^22.0.0","@types/picomatch":"^4.0.2","husky":"^9.1.7","lint-staged":"^16.2.7","tsup":"^8.0.0"},"keywords":["svelte","sveltekit","typescript","type-checker","tsgo","typescript-go"],"publishConfig":{"access":"public"},"license":"MIT","author":{"name":"Aljosa Asanovic"},"contributors":[{"name":"Song Jaehak","email":"astralhpi@gmail.com","url":"https://github.com/astralhpi"}],"repository":{"type":"git","url":"git+https://github.com/alasano/svelte-fast-check.git"},"bugs":{"url":"https://github.com/alasano/svelte-fast-check/issues"},"homepage":"https://github.com/alasano/svelte-fast-check#readme","_id":"@alasano/svelte-fast-check@0.4.6-fork.2","gitHead":"ffb1fd09435a0080d3d1e4e6311c673345e86884","_nodeVersion":"22.22.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-urF3tmj0GWwGgPMA+QDsyh6Oy+sR6JlLamjZ1r/BlJhOWVFiyzFaU0fjQDGrMziAA88i6Lqe9hdTEicW0eS2fg==","shasum":"5ddb024b3473e1b5689ed274ba37e1290e791fb8","tarball":"https://registry.npmjs.org/@alasano/svelte-fast-check/-/svelte-fast-check-0.4.6-fork.2.tgz","fileCount":9,"unpackedSize":122192,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCswpwr58SkC+uioqDIyfHTf3EqdRdTnJ42zMdwjxSIpgIhALXTYxmBVwDohFg+/ZQciu2XYM2ZNpd2OoJJW1uJOPta"}]},"_npmUser":{"name":"alasano","email":"aljosa.a@gmail.com"},"directories":{},"maintainers":[{"name":"alasano","email":"aljosa.a@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/svelte-fast-check_0.4.6-fork.2_1772300848720_0.3554891437372427"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T18:22:17.099Z","modified":"2026-02-28T17:47:28.969Z","0.4.6-fork.1":"2026-02-20T18:22:17.336Z","0.4.6-fork.2":"2026-02-28T17:47:28.860Z"},"bugs":{"url":"https://github.com/alasano/svelte-fast-check/issues"},"author":{"name":"Aljosa Asanovic"},"license":"MIT","homepage":"https://github.com/alasano/svelte-fast-check#readme","keywords":["svelte","sveltekit","typescript","type-checker","tsgo","typescript-go"],"repository":{"type":"git","url":"git+https://github.com/alasano/svelte-fast-check.git"},"description":"Up to 24x faster type and Svelte compiler warning checker for Svelte/SvelteKit projects using svelte2tsx + tsgo","contributors":[{"name":"Song Jaehak","email":"astralhpi@gmail.com","url":"https://github.com/astralhpi"}],"maintainers":[{"name":"alasano","email":"aljosa.a@gmail.com"}],"readme":"# svelte-fast-check\n\nUp to 24x faster type and Svelte compiler warning checker for Svelte/SvelteKit projects.\n\n[Korean](./README.ko.md)\n\n## Status\n\nExperimental — depends on [TypeScript 7 (tsgo)](https://github.com/microsoft/typescript-go) preview. But actively used by the author in production.\n\n## Why svelte-fast-check?\n\nTwo things make `svelte-check` slow for development:\n\n1. **No incremental check** - Re-checks everything on every run\n2. **tsc is slow** - Single-threaded, no parallelism\n\nWe fix both:\n\n| Problem | Solution |\n|---------|----------|\n| No incremental | [tsgo](https://github.com/microsoft/typescript-go) supports incremental check |\n| tsc is slow | tsgo is 5-10x faster (Go-based, parallel) |\n\nEverything else stays the same - we use the same svelte2tsx and svelte/compiler as svelte-check.\n\n## What Gets Checked\n\n- **TypeScript errors** in `.ts` and `.svelte` files\n- **Svelte compiler warnings** — unused CSS, a11y hints, `state_referenced_locally`, etc.\n\n**Not included:** CSS language service diagnostics — use [eslint-plugin-svelte](https://github.com/sveltejs/eslint-plugin-svelte) or [Biome](https://biomejs.dev/) (v2.3.11+)\n\n## Benchmark\n\nMeasured on a 282-file Svelte project (M4 Pro):\n\n| Command                                  | Time  | Comparison      |\n| ---------------------------------------- | ----- | --------------- |\n| `svelte-check`                           | 14.4s | baseline        |\n| `svelte-fast-check`                      | 2.6s  | **5.5x faster** |\n| `svelte-fast-check --incremental` (cold) | 6.0s  | 2.4x faster     |\n| `svelte-fast-check --incremental` (warm) | 0.6s  | **24x faster**  |\n\n## Requirements\n\n- **Node.js 22+** or **Bun**\n- Svelte 5+\n- TypeScript 5+\n\n## Installation\n\n```bash\nnpm install -D svelte-fast-check\n# or\nbun add -D svelte-fast-check\n```\n\n## Usage\n\n```bash\n# Basic\nnpx svelte-fast-check\n\n# Incremental mode (recommended)\nnpx svelte-fast-check --incremental\n```\n\n### Running with Bun\n\nBy default, CLI scripts with `#!/usr/bin/env node` shebang run with Node.js even when using Bun. To run with Bun runtime for better performance, use the `--bun` flag:\n\n```bash\n# Runs with Node.js (default)\nbun svelte-fast-check --incremental\n\n# Runs with Bun runtime (faster)\nbun --bun svelte-fast-check --incremental\n```\n\nOr configure in `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"check\": \"bun --bun svelte-fast-check --incremental\"\n  }\n}\n```\n\n### CLI Options\n\n| Option                 | Short | Description                                            |\n| ---------------------- | ----- | ------------------------------------------------------ |\n| `--incremental`        | `-i`  | Convert only changed files, use tsgo incremental build |\n| `--project <path>`     | `-p`  | Specify tsconfig.json path (for monorepos)             |\n| `--no-svelte-warnings` |       | Skip Svelte compiler warnings (type check only)        |\n| `--raw`                | `-r`  | Show raw output without filtering/mapping              |\n| `--config <path>`      | `-c`  | Specify config file path                               |\n\n## Configuration\n\nWorks out of the box for most projects. Automatically reads `paths`, `exclude`, and `files` from `tsconfig.json`.\n\nFor custom configuration, create `svelte-fast-check.config.ts`:\n\n```typescript\nimport type { FastCheckConfig } from 'svelte-fast-check';\n\nexport default {\n  srcDir: './src',\n  exclude: ['../src/**/*.test.ts'],\n} satisfies FastCheckConfig;\n```\n\n## How It Works\n\n```\n                    ┌─→ svelte2tsx → tsgo → filter → map ─────→┐\n.svelte files ──────┤                                          ├──→ merged diagnostics\n                    └─→ svelte.compile (warnings) → filter ───→┘\n```\n\nTwo pipelines run in parallel:\n\n1. **Type checking**: svelte2tsx converts `.svelte` to `.tsx`, then tsgo type-checks\n2. **Compiler warnings**: `svelte.compile({ generate: false })` collects Svelte-specific warnings\n\nBoth results are merged and displayed together.\n\n## Design\n\n### Where the Time Goes\n\nOn a 282-file Svelte project:\n\n**Cold (~2.6s):**\n```\nsvelte2tsx (~640ms)\n    ↓\n┌───┴───┐\ntsgo    svelte/compiler   ← runs in parallel\n(~2000ms)  (~700ms)\n└───┬───┘\n    ↓\n~2600ms\n```\n\n**Incremental warm (~0.6s):**\n```\nsvelte2tsx (skip unchanged)\n    ↓\n┌───┴───┐\ntsgo    svelte/compiler   ← both use cache\n(~500ms)   (skip unchanged)\n└───┬───┘\n    ↓\n~600ms\n```\n\nThe speedup comes from:\n1. **tsgo** - 5-10x faster than tsc (Go-based, parallel, incremental)\n2. **Parallel execution** - Type checking and svelte/compiler run simultaneously\n3. **Incremental caching** - svelte2tsx and svelte/compiler skip unchanged files\n\n**Why keep svelte2tsx and svelte/compiler?**\n\nRewriting the parser would only save ~640ms. Considering maintenance burden and stability, using the official tooling is better:\n- Same [svelte2tsx](https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx) as svelte-check - guaranteed compatibility\n- New Svelte syntax (like Runes) works immediately by updating peer dependencies\n- Zero maintenance burden for parser updates\n\n### What We Don't Do\n\n`svelte-check` already handles these well. No need to reinvent:\n\n- **Language Server** - IDE features (autocompletion, hover, go to definition)\n- **Watch mode** - file change detection and auto-rerun\n\nFor these features, use `svelte-check` or `svelte-language-server`.\n\n## Limitations\n\n- **tsgo is still in preview.**\n- **False positives** - Known cases are handled. If you find more, please [open an issue](https://github.com/astralhpi/svelte-fast-check/issues).\n\n## Using with svelte-check\n\nWe recommend using `svelte-fast-check` for fast feedback during development, and `svelte-check` for accurate validation in CI:\n\n```json\n{\n  \"scripts\": {\n    \"check\": \"svelte-fast-check --incremental\",\n    \"check:ci\": \"svelte-check\"\n  }\n}\n```\n\n## Motivation\n\nAs my project grew, `svelte-check` became slow. I wanted to try incremental builds and typescript-go.\n\n`svelte-check` has a lot to consider - Language Server compatibility, cross-platform support, and more - so adopting experimental features like tsgo isn't easy. Official support will take time, so I built this to use in the meantime.\n\nSee also:\n\n- [Incremental build support request](https://github.com/sveltejs/language-tools/issues/2131) (2023~)\n- [typescript-go support request](https://github.com/sveltejs/language-tools/issues/2733) (Blocked)\n\n## Credits\n\nBuilt with [svelte2tsx](https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx) from [svelte-language-tools](https://github.com/sveltejs/language-tools) and [Svelte compiler](https://github.com/sveltejs/svelte). Inspired by [svelte-check](https://github.com/sveltejs/language-tools/tree/master/packages/svelte-check).\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Song Jaehak (astralhpi)\n\n---\n\nBuilt at [melting.chat](https://melting.chat)\n","readmeFilename":"README.md"}