wevm / vocs

Minimal Documentation Framework, powered by React + Vite.
https://vocs.dev
Other
1.13k stars 54 forks source link

Build not failing with TypeScript error on Twoslash code block #187

Open guidanoli opened 2 months ago

guidanoli commented 2 months ago

From https://vocs.dev/docs/guides/twoslash#errors:

Shiki Twoslash then shows a pretty error, and will set the process exit code to 1 failing any builds.

Suppose I have this index.mdx file:

```ts twoslash
const a = "123"
a = 132

When on `vocs dev`, I can see it raises an error:

Errors were thrown in the sample, but not included in an error tag

These errors were not marked as being expected: 2588. Expected: // @errors: 2588

Compiler Errors:

index.ts [2588] 16 - Cannot assign to 'a' because it is a constant.



When I run `vocs build`, it does not exit with code 1.
guidanoli commented 2 months ago

If this is not the intended behavior, it would be nice to have a tag that I could add to trigger a build failure, in case there is some change in the software API that was not mirrored in the documentation.