vocs icon indicating copy to clipboard operation
vocs copied to clipboard

Build not failing with TypeScript error on Twoslash code block

Open guidanoli opened this issue 1 year ago • 1 comments

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 avatar Jul 15 '24 00:07 guidanoli

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.

guidanoli avatar Jul 15 '24 00:07 guidanoli

Builds now fail if Twoslash errors are thrown.

jxom avatar Oct 04 '24 10:10 jxom