Menu

1 / 4

Show svelte-check's errors in your GitLab merge requests (and GitHub pull requests)

DEV Community: typescript·faissalrez·8 days ago
#f3mJ6AmP
#devtotypescript#devto#dev#svelte#errors
Reading 0:00
15s threshold

If your SvelteKit project runs svelte-check in CI, you've probably seen this: the job fails, and the type errors are somewhere in the job log. Reviewers have to open the log, scroll, and map each line back to the diff. Meanwhile, ESLint's errors show up right in the merge request, because ESLint has formatters for GitLab and GitHub.

svelte-check doesn't, and that's on purpose: its maintainers prefer not to add output formats , and point to its machine-readable output instead. So I wrote the conversion: svelte-check-reporter . This post explains how it works, and the parts that weren't obvious.

What svelte-check gives you

With --output machine-verbose , svelte-check prints one JSON diagnostic per line, after a timestamp:

1762500000000 START "/builds/my-app" 1762500001000 {"type":"ERROR","filename":"src/lib/cart.ts","start":{"line":3,"character":56},"end":{"line":3,"character":61},"message":"Property 'prise' does not exist on type 'Product'.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.