Skip to content

Commit

Permalink
docs: schema.json in node_modules (#9832)
Browse files Browse the repository at this point in the history
### Description

Documenting `schema.json` availability in `node_modules` starting in
2.4.

### Testing Instructions

👀

---------

Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com>
  • Loading branch information
anthonyshew and chris-olszewski authored Jan 31, 2025
1 parent 72413c3 commit b04f81d
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions docs/repo-docs/getting-started/editor-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,43 @@ Turborepo uses [JSON Schema](https://json-schema.org/) to give you auto-complete
`turbo.json` file. By including the `$schema` key in your `turbo.json`, your editor is able to
provide full documentation and linting in case you have invalid shapes or missing keys.

### Sourcing from the web

A `schema.json` is accessible at the URL shown below. This has the advantage of not needing to run your package manager's install command to see in-editor validation.

```json title="./turbo.json"
{
"$schema": "https://turbo.build/schema.json"
}
```

### Older versions

If you are using Turborepo v1, use `schema.v1.json`.
There is also a major versioned `schema.json` available, following the format of `https://turbo.build/schema.<version>.json`.

```json title="./turbo.json"
{
"$schema": "https://turbo.build/schema.v1.json"
}
```

### Sourcing from `node_modules`

Starting in Turborepo 2.4, `schema.json` is available in `node_modules` once you've run your package manager's install command:

```json title="turbo.json"
{
"$schema": "./node_modules/turbo/schema.json"
}
```

<Callout title="node_modules location">
We recommend installing `turbo` at the root of your repository, so the path
for the schema should point to `node_modules` at the root of your repository.
In [Package Configurations](/repo/docs/reference/package-configurations), you
may need to use a path like `../../node_modules/turbo/schema.json`.
</Callout>

## Linting for environment variables

Handling environment variables is an important part of building applications in a Turborepo.

[The `eslint-config-turbo` package](/repo/docs/reference/eslint-config-turbo) extends your ESLint setup to help you make sure you've taken care of all of your environment variables.
Expand Down

0 comments on commit b04f81d

Please sign in to comment.