Skip to content

fix: correctly specify return type of CANCEL_SYMBOL - #601

Open
gameroman wants to merge 2 commits into
bombshell-dev:mainfrom
gameroman:fix-types
Open

fix: correctly specify return type of CANCEL_SYMBOL#601
gameroman wants to merge 2 commits into
bombshell-dev:mainfrom
gameroman:fix-types

Conversation

@gameroman

@gameroman gameroman commented Sep 8, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Closes #600

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8ae1524

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clack/core Patch
@clack/prompts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2026

Copy link
Copy Markdown

commit: 8ae1524

@gameroman
gameroman requested review from 43081j and dreyfus92 and removed request for 43081j September 8, 2026 13:53
@trueberryless

Copy link
Copy Markdown
Contributor

Could you add a changeset with a patch bump, pls?

@dreyfus92 dreyfus92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good! but, could we add a type-level regression test? something like

if (isCancel(value)) return;
expectTypeOf(value).toEqualTypeOf<string>();

inside an existing text or path test. tsc passed on the 1.8.0 base, so nothing today would fail if the narrowing drifts again. expectTypeOf is already available from vitest and the test dirs are typechecked in CI.

cc @43081j

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.

[Bug] isCancel no longer narrows prompt results after 1.5.0

3 participants