From 3f9bd0ca955c4b1f4a80720fb76520b31159a71c Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Tue, 28 Jan 2025 14:09:29 -0700 Subject: [PATCH 1/2] docs: schema.json in node_modules --- .../getting-started/editor-integration.mdx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/repo-docs/getting-started/editor-integration.mdx b/docs/repo-docs/getting-started/editor-integration.mdx index 826202beb72ec..d61d995313810 100644 --- a/docs/repo-docs/getting-started/editor-integration.mdx +++ b/docs/repo-docs/getting-started/editor-integration.mdx @@ -13,15 +13,17 @@ 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 versioned `schema.json` available, following the format of `https://turbo.build/schema..json`. ```json title="./turbo.json" { @@ -29,6 +31,25 @@ If you are using Turborepo v1, use `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" +} +``` + + + 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`. + + +## 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. From 9f4cba8e5ffdeba452f7ff8a3a97d39853d180d3 Mon Sep 17 00:00:00 2001 From: Anthony Shew Date: Thu, 30 Jan 2025 16:05:04 -0700 Subject: [PATCH 2/2] Update docs/repo-docs/getting-started/editor-integration.mdx Co-authored-by: Chris Olszewski --- docs/repo-docs/getting-started/editor-integration.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/repo-docs/getting-started/editor-integration.mdx b/docs/repo-docs/getting-started/editor-integration.mdx index d61d995313810..73229a198b8bb 100644 --- a/docs/repo-docs/getting-started/editor-integration.mdx +++ b/docs/repo-docs/getting-started/editor-integration.mdx @@ -23,7 +23,7 @@ A `schema.json` is accessible at the URL shown below. This has the advantage of } ``` -There is also a versioned `schema.json` available, following the format of `https://turbo.build/schema..json`. +There is also a major versioned `schema.json` available, following the format of `https://turbo.build/schema..json`. ```json title="./turbo.json" {