Skip to content

feat: add --fail-on-warnings flag to check command#1

Open
ericsampson wants to merge 2 commits intoampcode:mainfrom
ericsampson:feat/fail-on-warnings
Open

feat: add --fail-on-warnings flag to check command#1
ericsampson wants to merge 2 commits intoampcode:mainfrom
ericsampson:feat/fail-on-warnings

Conversation

@ericsampson
Copy link

@ericsampson ericsampson commented Dec 7, 2025

Summary

  • Add --fail-on-warnings flag to the check command that exits with code 1 when warnings are present
  • Mirrors the behavior of the underlying svelte-check --fail-on-warnings flag
  • When daemon is running: checks hasWarnings status and fails if true
  • When falling back to direct svelte-check: passes --fail-on-warnings to the underlying command

Motivation

The hasWarnings field was already being tracked by the daemon but wasn't used for exit code logic. This feature allows CI pipelines to enforce warning-free code, matching what users expect from svelte-check --fail-on-warnings.

Changes

  • bin/svelte-check-daemon.js: Parse --fail-on-warnings flag and use it in exit code logic
  • src/client.ts: Pass --fail-on-warnings to svelte-check when running directly
  • package.json: Bump version to 0.1.0

Test plan

  • Build passes (npm run build)
  • Manual test: svelte-check-daemon check --fail-on-warnings fails when warnings exist
  • Manual test: svelte-check-daemon check (without flag) succeeds with warnings

Add support for the --fail-on-warnings flag that mirrors the behavior
of the underlying svelte-check CLI. When this flag is passed to the
check command:

- If running in daemon mode: exit with code 1 when hasWarnings is true
- If running svelte-check directly (fallback): pass --fail-on-warnings
  to svelte-check

This allows CI pipelines to fail on warnings, matching the behavior
users expect from svelte-check --fail-on-warnings.

Bumps version to 0.1.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ericsampson ericsampson force-pushed the feat/fail-on-warnings branch from 2e04a09 to e2304af Compare December 26, 2025 19:11
@ericsampson ericsampson force-pushed the feat/fail-on-warnings branch from e2304af to bb2cee8 Compare December 26, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant