[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110335":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":13,"starSnapshotCount":13,"syncStatus":37,"lastSyncTime":38,"discoverSource":39},110335,"svelte-check-reporter","faissalrez\u002Fsvelte-check-reporter","faissalrez","Show svelte-check's Svelte and TypeScript errors in GitHub pull requests and GitLab merge requests: Code Quality reports, Actions annotations and SARIF for code scanning.","https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fsvelte-check-reporter",null,"TypeScript",71,0,67,6,40.6,"MIT License",false,"main",[21,22,23,24,25,26,27,28,29,30,31,32],"annotations","ci","code-quality","code-scanning","github-actions","gitlab","gitlab-ci","sarif","svelte","svelte-check","sveltekit","typescript","2026-11-08 01:48:35","2026-11-21 05:56:55","# svelte-check-reporter\n\n[![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fsvelte-check-reporter)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fsvelte-check-reporter)\n[![CI](https:\u002F\u002Fgithub.com\u002Ffaissalrez\u002Fsvelte-check-reporter\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ffaissalrez\u002Fsvelte-check-reporter\u002Factions\u002Fworkflows\u002Fci.yml)\n\nSee Svelte and TypeScript errors where you review code: in GitHub pull requests and GitLab merge requests.\n\nPipe [svelte-check](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fsvelte-check) into your existing CI to get annotations and native reports. No runtime dependencies.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fimages\u002Fgithub-annotation-dark.png\">\n  \u003Cimg alt=\"A Svelte accessibility warning and a TypeScript error annotated directly on a GitHub pull request's diff\" src=\"docs\u002Fimages\u002Fgithub-annotation.png\">\n\u003C\u002Fpicture>\n\n- See new and fixed findings in GitLab, and newly introduced alerts in GitHub code scanning.\n- See existing GitLab findings stay matched when lines above them change.\n- See errors and warnings at their original severity, with the check failing on errors and passing on warnings alone.\n\nDemos: [GitHub annotations](https:\u002F\u002Fgithub.com\u002Ffaissalrez\u002Fsvelte-check-reporter-demo\u002Fpull\u002F1) · [GitHub code scanning](https:\u002F\u002Fgithub.com\u002Ffaissalrez\u002Fsvelte-check-reporter-demo\u002Fpull\u002F2) · [GitLab Code Quality](https:\u002F\u002Fgitlab.com\u002Ffaissalrez\u002Fsvelte-check-reporter-demo\u002F-\u002Fmerge_requests\u002F1)\n\n## Get started\n\nInstall alongside your existing `svelte-check` dependency:\n\n```sh\nnpm install --save-dev svelte-check-reporter\n```\n\nAdd one pipe to your check command:\n\n```sh\n# GitHub Actions annotations\nnpx svelte-check --output machine-verbose | npx svelte-check-reporter --format github\n\n# GitLab Code Quality\nnpx svelte-check --output machine-verbose | npx svelte-check-reporter --output-file gl-codequality.json\n```\n\nFor GitHub code scanning, follow the [SARIF setup](#github-code-scanning).\n\nThe reporter reads svelte-check's `machine-verbose` output and converts each diagnostic. It handles `.svelte` and `.ts` files, keeps errors and warnings distinct, and prints every diagnostic to the job log.\n\nRequires Node.js 18.3 or later. Run from the repository root so file paths match your repository. For SvelteKit projects, run `npx svelte-kit sync` before the check.\n\n## Choose your integration\n\nUse the format your CI displays natively:\n\n| Integration | What reviewers see | Setup |\n| --- | --- | --- |\n| [GitLab Code Quality](#gitlab-code-quality) | New and fixed findings in the merge request | Generate a report and declare a job artifact |\n| [GitHub annotations](#github-annotations) | Errors and warnings on the workflow run and pull request diff | One command, no upload step |\n| [GitHub code scanning](#github-code-scanning) | Tracked alerts, with new findings on the pull request diff | Generate SARIF and upload it |\n\nOn GitHub, start with annotations for the least setup. Choose code scanning to track alerts across runs and focus reviews on new findings. Use one of the two to avoid reporting the same diagnostics through both integrations.\n\n## GitLab Code Quality\n\nShow which findings a merge request introduces and which it fixes, alongside reports from your other Code Quality tools.\n\nSee the results in the [demo merge request !1](https:\u002F\u002Fgitlab.com\u002Ffaissalrez\u002Fsvelte-check-reporter-demo\u002F-\u002Fmerge_requests\u002F1).\n\nThe Reports tab lists new and fixed findings:\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fimages\u002Fgitlab-reports-dark.png\">\n  \u003Cimg alt=\"A GitLab merge request's Reports tab showing three new findings and one fixed finding\" src=\"docs\u002Fimages\u002Fgitlab-reports.png\" width=\"640\">\n\u003C\u002Fpicture>\n\nIn the Changes view, reviewers can open a finding directly from its marker in the diff:\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fimages\u002Fgitlab-diff-dark.png\">\n  \u003Cimg alt=\"Code Quality markers in a GitLab merge request's Changes view, with one finding opened\" src=\"docs\u002Fimages\u002Fgitlab-diff.png\" width=\"640\">\n\u003C\u002Fpicture>\n\nAdd this job to `.gitlab-ci.yml`:\n\n```yaml\ncheck:\n  image: node:24-alpine\n  script:\n    - npm ci\n    - npx svelte-kit sync\n    - npx svelte-check --output machine-verbose | npx svelte-check-reporter --output-file gl-codequality.json\n  artifacts:\n    when: always\n    reports:\n      codequality: gl-codequality.json\n```\n\nRemove the `svelte-kit sync` step if your project doesn't use SvelteKit.\n\nThe job must also run on the merge request's target branch, usually `main`. GitLab uses that branch's report as the baseline for identifying new and fixed findings.\n\nKeep `when: always`: the report must reach GitLab even when the check finds errors.\n\nGitLab combines Code Quality reports from multiple jobs. To distinguish svelte-check's messages from other tools, add `--prefix '[svelte-check] '` to the reporter command.\n\n\u003Cdetails>\n\u003Csummary>How findings stay matched when lines move\u003C\u002Fsummary>\n\nEach finding gets a fingerprint from its file, error code and message. The line number isn't included, so adding or removing lines above a finding doesn't make it new.\n\nIdentical findings in the same file are distinguished by their order. Changing the message prefix doesn't change fingerprints.\n\n\u003C\u002Fdetails>\n\n## GitHub annotations\n\nAnnotate errors and warnings on your workflow run and pull request diff, as shown in the opening screenshot. No additional action, personal access token or annotation permissions required.\n\nSee the annotations in [demo pull request #1](https:\u002F\u002Fgithub.com\u002Ffaissalrez\u002Fsvelte-check-reporter-demo\u002Fpull\u002F1).\n\nSave this workflow as `.github\u002Fworkflows\u002Fcheck.yml`:\n\n```yaml\nname: Svelte check\n\non: [pull_request]\n\npermissions:\n  contents: read\n\njobs:\n  check:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v7\n      - uses: actions\u002Fsetup-node@v7\n        with:\n          node-version: 24\n      - run: npm ci\n      - run: npx svelte-kit sync\n      - run: npx svelte-check --output machine-verbose | npx svelte-check-reporter --format github\n```\n\nRemove the `svelte-kit sync` step if your project doesn't use SvelteKit. To annotate pushes too, use `on: [push, pull_request]`.\n\nAnnotations include existing findings: GitHub doesn't compare this format with the base branch. GitHub displays at most [10 error and 10 warning annotations per step](https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest\u002Fchecks\u002Fruns#create-a-check-run). Every diagnostic remains in the job log, including those beyond the annotation limit.\n\n## GitHub code scanning\n\nTrack alerts across runs and show newly introduced findings on the pull request diff, including in `.svelte` files.\n\nSee the alerts in [demo pull request #2](https:\u002F\u002Fgithub.com\u002Ffaissalrez\u002Fsvelte-check-reporter-demo\u002Fpull\u002F2).\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fimages\u002Fgithub-code-scanning-dark.png\">\n  \u003Cimg alt=\"A GitHub code scanning comment pointing to a TypeScript error on a pull request's diff\" src=\"docs\u002Fimages\u002Fgithub-code-scanning.png\" width=\"640\">\n\u003C\u002Fpicture>\n\nRules use their diagnostic codes, such as `TS2322` or `state_referenced_locally`. Svelte compiler rules link to their documentation.\n\nSave this workflow as `.github\u002Fworkflows\u002Fcheck.yml`, using it instead of the annotations workflow:\n\n```yaml\nname: Svelte check\n\non:\n  push:\n    branches: [main]\n  pull_request:\n\njobs:\n  check:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      security-events: write\n      actions: read # Required for private repositories\n    steps:\n      - uses: actions\u002Fcheckout@v7\n      - uses: actions\u002Fsetup-node@v7\n        with:\n          node-version: 24\n      - run: npm ci\n      - run: npx svelte-kit sync\n      - run: npx svelte-check --output machine-verbose | npx svelte-check-reporter --format sarif --output-file svelte-check.sarif\n      - uses: github\u002Fcodeql-action\u002Fupload-sarif@v4\n        if: ${{ !cancelled() }}\n        with:\n          sarif_file: svelte-check.sarif\n          category: svelte-check\n```\n\nRemove the `svelte-kit sync` step if your project doesn't use SvelteKit. Replace `main` with your target branch if it has a different name.\n\nThe workflow also analyzes the target branch so GitHub can identify new findings. `security-events: write` permits the upload, and `if: ${{ !cancelled() }}` uploads the report even when the check finds errors.\n\n\u003Cdetails>\n\u003Csummary>Alert matching and SARIF limits\u003C\u002Fsummary>\n\nThe reporter leaves fingerprint generation to `upload-sarif`. GitHub uses the source files to [match alerts across analyses](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcode-security\u002Freference\u002Fcode-scanning\u002Fsarif-files\u002Fsarif-support#data-for-preventing-duplicated-alerts), allowing findings to stay matched when their line numbers change.\n\nSARIF uses a separate upload path from workflow annotations. GitHub's [SARIF limits](https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcode-security\u002Freference\u002Fcode-scanning\u002Fsarif-files\u002Fsarif-support#file-compatibility) still apply, including limits on uploaded and displayed results.\n\n\u003C\u002Fdetails>\n\n## Diagnostics and exit codes\n\nEvery format preserves the diagnostic's severity:\n\n| svelte-check | GitLab Code Quality | GitHub annotations | GitHub code scanning |\n| --- | --- | --- | --- |\n| Error | `major` | Error annotation | `error` |\n| Warning | `minor` | Warning annotation | `warning` |\n\nThe job log includes each diagnostic and a summary:\n\n```text\nsrc\u002Flib\u002Fdb.ts:29:24  error  Property 'topology' does not exist on type 'MongoClient'.  TS2339\n\n1 error, 0 warnings\n```\n\nErrors fail the command. Warnings alone don't. The reporter's exit code decides the job's result, so svelte-check's `--fail-on-warnings` has no effect through the pipe.\n\n| Exit code | Meaning |\n| --- | --- |\n| `0` | No errors. Warnings are allowed. |\n| `1` | svelte-check reported errors. |\n| `2` | The reporter couldn't complete: invalid options, missing or unreadable input, incomplete svelte-check output, or a report-writing failure. |\n\nIf svelte-check crashes before completing, the reporter fails rather than producing an empty report that looks clean.\n\n## CLI reference\n\nThe reporter reads from standard input. Use these options to choose its output:\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--format \u003Cformat>` | `gitlab` | Output format: `gitlab`, `github` or `sarif`. |\n| `--output-file \u003Cpath>` | None | Required for `gitlab` and `sarif`. The reporter creates missing parent directories. Not allowed with `github`, which prints annotations to the log. |\n| `--prefix \u003Ctext>` | None | Prepend text to messages in `gitlab` and `github`, for example `'[svelte-check] '`. Ignored by `sarif`, where GitHub displays the tool's name. |\n\n## Compatibility\n\nThe reporter reads svelte-check's output without importing Svelte or SvelteKit:\n\n| Dependency | Supported | Tested |\n| --- | --- | --- |\n| Node.js | 18.3 and later | 18.3, 18, 20, 22 and 24 in [CI](.github\u002Fworkflows\u002Fci.yml) |\n| svelte-check | Versions with `--output machine-verbose` | 4.7 |\n| Svelte | Versions checked by svelte-check | 5 |\n| SvelteKit | Optional | 2 and 3 |\n\n## Troubleshooting\n\n\u003Cdetails>\n\u003Csummary>The GitLab report doesn't show new and fixed findings\u003C\u002Fsummary>\n\nCheck that the target branch has a completed pipeline with a Code Quality report. GitLab needs this baseline to compare the merge request's findings.\n\nAlso keep `artifacts: when: always` so the report is uploaded when svelte-check finds errors.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>The same finding appears twice on a GitHub pull request\u003C\u002Fsummary>\n\nGitHub's new diff view can show a code scanning alert twice: once as a bot comment and once as an annotation from the code scanning check.\n\nBoth refer to the same alert.\n\n\u003C\u002Fdetails>\n\n## Roadmap\n\nPrioritize GitHub annotations for files changed by the pull request, so the available annotation slots go to those files first.\n\n## License\n\n[MIT](LICENSE)\n","svelte-check-reporter 是一个用于将 svelte-check 的 Svelte 和 TypeScript 类型检查结果集成到 CI\u002FCD 流程中的工具，支持在 GitHub Pull Request 和 GitLab Merge Request 中以代码注解、Code Quality 报告及 SARIF 格式呈现错误与警告。其核心功能包括：解析 svelte-check 的 machine-verbose 输出，保留原始严重级别（error\u002Fwarning），精准映射文件路径与行号，支持 GitHub Actions 注解、GitLab CI Code Quality 报告和 GitHub Advanced Security 的代码扫描。适用于使用 Svelte 或 SvelteKit 构建的 TypeScript 项目，在团队协作代码审查阶段提升静态检查可见性与问题定位效率。",2,"2026-11-24 04:38:41","CREATED_QUERY"]