Skip to content

Code Block Type Checking#

View Markdown

Type-checking is opt-in because it shells out to tsgo. By default, only TypeScript fences marked with typecheck or twoslash are checked.

import { oxContent } from "@ox-content/vite-plugin";

export default {
  plugins: [
    oxContent({
      codeBlockTypecheck: {
        languages: ["ts", "tsx"],
        requireMeta: true,
        tsgoCommand: "tsgo",
        mode: "error",
      },
    }),
  ],
};
```ts typecheck
const value: string = "ok";
```

Set requireMeta: false to check every TypeScript fence.

Last updated: