> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meow.style/llms.txt
> Use this file to discover all available pages before exploring further.

# Type checking

> meow check runs tsc over a generated config and renders type errors as structured diagnostics.

Running a `.ts` file [strips types without checking them](/runtime/typescript#type-checking-is-separate-from-running) —
that keeps execution fast. When you want the full type-checker, run `meow check`.

```bash theme={null}
meow check                 # type-check the whole project
meow check src/api.ts      # check specific paths
```

## How it works

`meow check` delegates to the real **TypeScript compiler** (`tsc`) over the
generated shadow config, then parses its output and re-renders it as meow
diagnostics — so you get `tsc`'s correctness with meow's presentation.

<Steps>
  <Step title="It needs the shadow config">
    `meow check` reads `.meow/tsconfig.json`. If it's missing, meow tells you to
    generate it:

    ```text theme={null}
    meow check: no .meow/tsconfig.json found — run `meow sync` first
    ```

    `meow init` runs `meow sync` for you; otherwise run it once (and after any
    `meow.config.json` change). See [the shadow config](/concepts/project-layout#the-generated-shadow-config).
  </Step>

  <Step title="It resolves tsc through meow x">
    meow runs `tsc` via its own [`meow x`](/package-manager/running-binaries) — using
    your locally installed TypeScript if you've added it, or fetching it ephemerally
    if not. There's no `node_modules/.bin` or `$PATH` hunt; the package graph
    resolves the binary.

    ```bash theme={null}
    meow add -D typescript     # optional: pin a specific tsc version
    ```
  </Step>

  <Step title="It renders the results">
    `tsc` runs with `--noEmit` over the shadow config; meow parses each
    `file(line,col): error TS####: message` and frames it with a code snippet and a
    caret.
  </Step>
</Steps>

## Output

A clean run:

```text theme={null}
🐾 meow check: no type errors
```

An error, framed as a diagnostic with the offending line and a caret:

```text theme={null}
  error[TS2322] src/api.ts
  12 │ const port: number = "3000";
     │       ────  ^^^^^^ Type 'string' is not assignable to type 'number'.
✗ meow check: found 1 type error
```

`meow check` exits non-zero when there are type errors, so it drops straight into
CI and pre-commit hooks.

## The generated config

The shadow `.meow/tsconfig.json` sets a strict-web-correct baseline so your editor
and `meow check` agree:

```json theme={null}
{
  "compilerOptions": {
    "strict": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "target": "esnext",
    "lib": ["esnext"],
    "verbatimModuleSyntax": true,
    "isolatedModules": true,
    "erasableSyntaxOnly": true,
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "skipLibCheck": true
  }
}
```

`strict` follows `types.strict` in your [`meow.config.json`](/configuration/meow-config).
The `meow:*` modules and strict-web globals are wired in automatically, so
`import { serve } from "meow:http"` type-checks with nothing installed.

<Card title="Lint next" icon="broom" href="/toolchain/lint">
  Static analysis over the same shared syntax tree.
</Card>
