Skip to content

Commit b04f81d

Browse files
docs: schema.json in node_modules (#9832)
### Description Documenting `schema.json` availability in `node_modules` starting in 2.4. ### Testing Instructions 👀 --------- Co-authored-by: Chris Olszewski <[email protected]>
1 parent 72413c3 commit b04f81d

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

docs/repo-docs/getting-started/editor-integration.mdx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,43 @@ Turborepo uses [JSON Schema](https://json-schema.org/) to give you auto-complete
1313
`turbo.json` file. By including the `$schema` key in your `turbo.json`, your editor is able to
1414
provide full documentation and linting in case you have invalid shapes or missing keys.
1515

16+
### Sourcing from the web
17+
18+
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.
19+
1620
```json title="./turbo.json"
1721
{
1822
"$schema": "https://turbo.build/schema.json"
1923
}
2024
```
2125

22-
### Older versions
23-
24-
If you are using Turborepo v1, use `schema.v1.json`.
26+
There is also a major versioned `schema.json` available, following the format of `https://turbo.build/schema.<version>.json`.
2527

2628
```json title="./turbo.json"
2729
{
2830
"$schema": "https://turbo.build/schema.v1.json"
2931
}
3032
```
3133

34+
### Sourcing from `node_modules`
35+
36+
Starting in Turborepo 2.4, `schema.json` is available in `node_modules` once you've run your package manager's install command:
37+
38+
```json title="turbo.json"
39+
{
40+
"$schema": "./node_modules/turbo/schema.json"
41+
}
42+
```
43+
44+
<Callout title="node_modules location">
45+
We recommend installing `turbo` at the root of your repository, so the path
46+
for the schema should point to `node_modules` at the root of your repository.
47+
In [Package Configurations](/repo/docs/reference/package-configurations), you
48+
may need to use a path like `../../node_modules/turbo/schema.json`.
49+
</Callout>
50+
51+
## Linting for environment variables
52+
3253
Handling environment variables is an important part of building applications in a Turborepo.
3354

3455
[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.

0 commit comments

Comments
 (0)