Skip to content

feat: add no-check and expect-error properties to example fences - #319

Merged
LadyBluenotes merged 2 commits into
mainfrom
feat/example-fence-properties
Oct 4, 2026
Merged

LadyBluenotes merged 2 commits into
mainfrom
feat/example-fence-properties

Conversation

@LadyBluenotes

Copy link
Copy Markdown
Member

🎯 Changes

intent validate typechecks every ts, tsx, js, and jsx fence in a skill. The only way to exclude one example was to relabel it as text or diff, which removes the language from a valid teaching example. Two kinds of example need a different treatment:

  • A fragment, such as a single class member or a bare return, is not a complete source file and cannot compile.
  • A Wrong: example is supposed to fail. Nothing reported it when a library change made it compile.

A property after the fence language now controls how that one example is checked:

Fence Behavior
```ts no-check The example is not typechecked.
```ts expect-error The example must report at least one error. Validation fails when it compiles.
```ts expect-error=TS2322 The example must report that error code. Several codes are separated by commas, and quotes around the value are optional.
Wrong:

```ts expect-error=TS2322
retry(fetchUser, { max: 'many' })
```

Correct:

```ts
retry(fetchUser, { max: 3 })
```

An expect-error example reports nothing else; its errors and deprecation warnings are the expected result. When the expectation is not met, the error names the fence line:

skills/retries/SKILL.md:8: Expected TS2345, but the example reported TS2322.
skills/retries/SKILL.md:8: Expected an error, but the example compiles. Remove expect-error or correct the example.

Errors that Intent already tolerates in partial examples, such as an undeclared name, do not count as the expected error. A syntax error satisfies the plain expect-error, so the coded form is the way to require a specific failure.

Both properties work with the TypeScript 6 and TypeScript 7 compiler paths. A fence without a property behaves as before.

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d992e8a

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

This PR includes changesets to release 1 package
Name Type
@tanstack/intent 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

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71129456-4b41-4212-b98d-602d17e8af26
📥 Commits

Reviewing files that changed from the base of the PR and between 894ab61 and d992e8a.

📒 Files selected for processing (5)
  • .changeset/example-fence-properties.md
  • docs/cli/intent-validate.md
  • packages/intent/meta/tree-generator/references/write-skills.md
  • packages/intent/src/validate/blocks.ts
  • packages/intent/tests/validate-blocks.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 790d461

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 46s View ↗
nx run-many --targets=build ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-04 18:07:16 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@319

commit: d992e8a

@codspeed

codspeed Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing feat/example-fence-properties (d992e8a) with main (894ab61)

Open in CodSpeed

…operties

# Conflicts:
#	packages/intent/tests/validate-blocks.test.ts
@LadyBluenotes
LadyBluenotes merged commit 9d8a463 into main Oct 4, 2026
10 checks passed
@LadyBluenotes
LadyBluenotes deleted the feat/example-fence-properties branch October 4, 2026 21:38
@github-actions github-actions Bot mentioned this pull request Oct 4, 2026
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