> For the complete documentation index, see [llms.txt](https://builtwithluv.gitbook.io/mockit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://builtwithluv.gitbook.io/mockit/advance/typescript.md).

# Typescript

```
npm install --save-dev @babel/core @babel/node @babel/register @babel/preset-typescript
```

Add `@babel/preset-typescript` to your `.babelrc` file.

```
{
    "presets": [
        [
            "@babel/preset-typescript",
            {
                "allExtensions": true,
                "isTSX": true
            }
        ]
    ]
}
```

After you have this, run the command

```
npx mockit start --compiler @babel/register
```

If you received complaints about `SyntaxError: Unexpected identifier`, then try to add `@babel/preset-env` to your `presets` list after installing it.

`npm install --save-dev @babel/preset-env`

```
{
    "presets": [
        "@babel/preset-env",
        [
            "@babel/preset-typescript",
            {
                "allExtensions": true,
                "isTSX": true
            }
        ]
    ]
}
```
