diff --git a/.changeset/curvy-toes-laugh.md b/.changeset/curvy-toes-laugh.md new file mode 100644 index 00000000..ff36b7e7 --- /dev/null +++ b/.changeset/curvy-toes-laugh.md @@ -0,0 +1,5 @@ +--- +"@effect/language-service": minor +--- + +Generate a root `schema.json` for `tsconfig.json` plugin configuration, add typed Effect Language Service plugin options to that schema, and have `effect-language-service setup` add or remove the matching `$schema` entry automatically. diff --git a/README.md b/README.md index fe4ffc24..6fe095a3 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This package implements a TypeScript language service plugin that allows additio 2. Inside your tsconfig.json, you should add the plugin configuration as follows: ```jsonc { + "$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json", "compilerOptions": { "plugins": [ // ... other LSPs (if any) and as last @@ -231,7 +232,7 @@ so that across updates the patch will be re-applied again. The effect language service plugin comes with a builtin CLI tool that can be used to perform various utilities, checks and setups. Since it relies on typescript, we recommend to install it locally and run it locally to ensure it loads the same typescript version of your project rather than a global installation that may resolve to use a different TS version from the one of your project. ### `effect-language-service setup` -Runs through a wizard to setup/update some basic functionalities of the LSP in an interactive way. +Runs through a wizard to setup/update some basic functionalities of the LSP in an interactive way. This also keeps the `tsconfig.json` `$schema` aligned with the published Effect Language Service schema. ### `effect-language-service codegen` Automatically updates Effect codegens in your TypeScript files. This command scans files for `@effect-codegens` directives and applies the necessary code transformations. Use `--file` to update a specific file, or `--project` with a tsconfig file to update an entire project. The `--verbose` flag provides detailed output about which files are being processed and updated. diff --git a/packages/harness-effect-v3/__snapshots__/setup-cli.test.ts.snap b/packages/harness-effect-v3/__snapshots__/setup-cli.test.ts.snap index fd7eaef0..aaf48cb7 100644 --- a/packages/harness-effect-v3/__snapshots__/setup-cli.test.ts.snap +++ b/packages/harness-effect-v3/__snapshots__/setup-cli.test.ts.snap @@ -24,7 +24,7 @@ exports[`Setup CLI > should add Effect Language Service section to existing AGEN "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -51,7 +51,8 @@ exports[`Setup CLI > should add Effect Language Service section to existing AGEN "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -62,7 +63,7 @@ exports[`Setup CLI > should add LSP plugin alongside existing plugins > change s "file": "package.json", }, { - "description": "Add @effect/language-service plugin to existing plugins array", + "description": "Add $schema to tsconfig; Add @effect/language-service plugin to existing plugins array", "file": "tsconfig.json", }, ] @@ -88,7 +89,8 @@ exports[`Setup CLI > should add LSP plugin alongside existing plugins > tsconfig }, { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -106,7 +108,7 @@ exports[`Setup CLI > should add LSP with VS Code editor selected and configure V "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -133,7 +135,8 @@ exports[`Setup CLI > should add LSP with VS Code editor selected and configure V "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -144,7 +147,7 @@ exports[`Setup CLI > should generate changes for adding LSP with custom diagnost "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -173,7 +176,8 @@ exports[`Setup CLI > should generate changes for adding LSP with custom diagnost } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -184,7 +188,7 @@ exports[`Setup CLI > should generate changes for adding LSP with defaults > chan "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -207,7 +211,8 @@ exports[`Setup CLI > should generate changes for adding LSP with defaults > tsco "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -218,7 +223,7 @@ exports[`Setup CLI > should generate changes for adding LSP with prepare script "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -242,7 +247,8 @@ exports[`Setup CLI > should generate changes for adding LSP with prepare script "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -289,7 +295,7 @@ exports[`Setup CLI > should generate changes for removing LSP when already insta "file": "package.json", }, { - "description": "Remove @effect/language-service plugin from tsconfig", + "description": "Remove $schema from tsconfig; Remove @effect/language-service plugin from tsconfig", "file": "tsconfig.json", }, ] @@ -320,7 +326,7 @@ exports[`Setup CLI > should generate changes for removing LSP when already insta exports[`Setup CLI > should generate changes for updating existing LSP with new diagnostic severities > change summary 1`] = ` [ { - "description": "Update @effect/language-service plugin diagnostic severities", + "description": "Add $schema to tsconfig; Update @effect/language-service plugin diagnostic severities", "file": "tsconfig.json", }, ] @@ -340,14 +346,15 @@ exports[`Setup CLI > should generate changes for updating existing LSP with new } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; exports[`Setup CLI > should handle tsconfig with existing plugin having custom options and diagnosticSeverity > change summary 1`] = ` [ { - "description": "Update @effect/language-service plugin diagnostic severities", + "description": "Add $schema to tsconfig; Update @effect/language-service plugin diagnostic severities", "file": "tsconfig.json", }, ] @@ -397,7 +404,8 @@ exports[`Setup CLI > should handle tsconfig with existing plugin having custom o "exclude": [ "node_modules", "dist" - ] + ], +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -408,7 +416,7 @@ exports[`Setup CLI > should not override existing plugins when adding LSP plugin "file": "package.json", }, { - "description": "Add @effect/language-service plugin to existing plugins array", + "description": "Add $schema to tsconfig; Add @effect/language-service plugin to existing plugins array", "file": "tsconfig.json", }, ] @@ -445,7 +453,8 @@ exports[`Setup CLI > should not override existing plugins when adding LSP plugin } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -456,7 +465,7 @@ exports[`Setup CLI > should preserve all existing VSCode settings from real repo "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -479,14 +488,15 @@ exports[`Setup CLI > should preserve all existing VSCode settings from real repo "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; exports[`Setup CLI > should preserve existing LSP plugin options when updating diagnostic severities > change summary 1`] = ` [ { - "description": "Update @effect/language-service plugin diagnostic severities", + "description": "Add $schema to tsconfig; Update @effect/language-service plugin diagnostic severities", "file": "tsconfig.json", }, ] @@ -510,7 +520,8 @@ exports[`Setup CLI > should preserve existing LSP plugin options when updating d } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -531,7 +542,7 @@ exports[`Setup CLI > should preserve existing VSCode settings when adding LSP-sp "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -558,7 +569,8 @@ exports[`Setup CLI > should preserve existing VSCode settings when adding LSP-sp "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -685,12 +697,51 @@ exports[`Setup CLI > should remove only LSP plugin while preserving other plugin }" `; +exports[`Setup CLI > should replace existing tsconfig schema when adding LSP > change summary 1`] = ` +[ + { + "description": "Add @effect/language-service@workspace:* to devDependencies", + "file": "package.json", + }, + { + "description": "Update $schema in tsconfig; Add plugins array with @effect/language-service plugin", + "file": "tsconfig.json", + }, +] +`; + +exports[`Setup CLI > should replace existing tsconfig schema when adding LSP > package.json 1`] = ` +"{ + "name": "test-project", + "version": "1.0.0", + "dependencies": {}, +"devDependencies": { "@effect/language-service": "workspace:*" } +}" +`; + +exports[`Setup CLI > should replace existing tsconfig schema when adding LSP > tsconfig.json 1`] = ` +"{ + "$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json", + "compilerOptions": { + "strict": true, + "target": "ES2022", +"plugins": [ + { "name": "@effect/language-service" } +] + } +}" +`; + exports[`Setup CLI > should update LSP version when already installed with older version > change summary 1`] = ` [ { "description": "Update @effect/language-service from ^0.1.0 to ^0.2.0", "file": "package.json", }, + { + "description": "Add $schema to tsconfig", + "file": "tsconfig.json", + }, ] `; @@ -706,6 +757,21 @@ exports[`Setup CLI > should update LSP version when already installed with older }" `; +exports[`Setup CLI > should update LSP version when already installed with older version > tsconfig.json 1`] = ` +"{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "plugins": [ + { + "name": "@effect/language-service" + } + ] + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" +}" +`; + exports[`Setup CLI > should update outdated Effect Language Service section in AGENTS.md when enabling LSP > AGENTS.md 1`] = ` "# AGENTS.md @@ -730,7 +796,7 @@ exports[`Setup CLI > should update outdated Effect Language Service section in A "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -757,6 +823,7 @@ exports[`Setup CLI > should update outdated Effect Language Service section in A "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; diff --git a/packages/harness-effect-v4/__snapshots__/setup-cli.test.ts.snap b/packages/harness-effect-v4/__snapshots__/setup-cli.test.ts.snap index fd7eaef0..aaf48cb7 100644 --- a/packages/harness-effect-v4/__snapshots__/setup-cli.test.ts.snap +++ b/packages/harness-effect-v4/__snapshots__/setup-cli.test.ts.snap @@ -24,7 +24,7 @@ exports[`Setup CLI > should add Effect Language Service section to existing AGEN "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -51,7 +51,8 @@ exports[`Setup CLI > should add Effect Language Service section to existing AGEN "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -62,7 +63,7 @@ exports[`Setup CLI > should add LSP plugin alongside existing plugins > change s "file": "package.json", }, { - "description": "Add @effect/language-service plugin to existing plugins array", + "description": "Add $schema to tsconfig; Add @effect/language-service plugin to existing plugins array", "file": "tsconfig.json", }, ] @@ -88,7 +89,8 @@ exports[`Setup CLI > should add LSP plugin alongside existing plugins > tsconfig }, { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -106,7 +108,7 @@ exports[`Setup CLI > should add LSP with VS Code editor selected and configure V "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -133,7 +135,8 @@ exports[`Setup CLI > should add LSP with VS Code editor selected and configure V "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -144,7 +147,7 @@ exports[`Setup CLI > should generate changes for adding LSP with custom diagnost "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -173,7 +176,8 @@ exports[`Setup CLI > should generate changes for adding LSP with custom diagnost } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -184,7 +188,7 @@ exports[`Setup CLI > should generate changes for adding LSP with defaults > chan "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -207,7 +211,8 @@ exports[`Setup CLI > should generate changes for adding LSP with defaults > tsco "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -218,7 +223,7 @@ exports[`Setup CLI > should generate changes for adding LSP with prepare script "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -242,7 +247,8 @@ exports[`Setup CLI > should generate changes for adding LSP with prepare script "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -289,7 +295,7 @@ exports[`Setup CLI > should generate changes for removing LSP when already insta "file": "package.json", }, { - "description": "Remove @effect/language-service plugin from tsconfig", + "description": "Remove $schema from tsconfig; Remove @effect/language-service plugin from tsconfig", "file": "tsconfig.json", }, ] @@ -320,7 +326,7 @@ exports[`Setup CLI > should generate changes for removing LSP when already insta exports[`Setup CLI > should generate changes for updating existing LSP with new diagnostic severities > change summary 1`] = ` [ { - "description": "Update @effect/language-service plugin diagnostic severities", + "description": "Add $schema to tsconfig; Update @effect/language-service plugin diagnostic severities", "file": "tsconfig.json", }, ] @@ -340,14 +346,15 @@ exports[`Setup CLI > should generate changes for updating existing LSP with new } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; exports[`Setup CLI > should handle tsconfig with existing plugin having custom options and diagnosticSeverity > change summary 1`] = ` [ { - "description": "Update @effect/language-service plugin diagnostic severities", + "description": "Add $schema to tsconfig; Update @effect/language-service plugin diagnostic severities", "file": "tsconfig.json", }, ] @@ -397,7 +404,8 @@ exports[`Setup CLI > should handle tsconfig with existing plugin having custom o "exclude": [ "node_modules", "dist" - ] + ], +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -408,7 +416,7 @@ exports[`Setup CLI > should not override existing plugins when adding LSP plugin "file": "package.json", }, { - "description": "Add @effect/language-service plugin to existing plugins array", + "description": "Add $schema to tsconfig; Add @effect/language-service plugin to existing plugins array", "file": "tsconfig.json", }, ] @@ -445,7 +453,8 @@ exports[`Setup CLI > should not override existing plugins when adding LSP plugin } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -456,7 +465,7 @@ exports[`Setup CLI > should preserve all existing VSCode settings from real repo "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, ] @@ -479,14 +488,15 @@ exports[`Setup CLI > should preserve all existing VSCode settings from real repo "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; exports[`Setup CLI > should preserve existing LSP plugin options when updating diagnostic severities > change summary 1`] = ` [ { - "description": "Update @effect/language-service plugin diagnostic severities", + "description": "Add $schema to tsconfig; Update @effect/language-service plugin diagnostic severities", "file": "tsconfig.json", }, ] @@ -510,7 +520,8 @@ exports[`Setup CLI > should preserve existing LSP plugin options when updating d } } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -531,7 +542,7 @@ exports[`Setup CLI > should preserve existing VSCode settings when adding LSP-sp "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -558,7 +569,8 @@ exports[`Setup CLI > should preserve existing VSCode settings when adding LSP-sp "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; @@ -685,12 +697,51 @@ exports[`Setup CLI > should remove only LSP plugin while preserving other plugin }" `; +exports[`Setup CLI > should replace existing tsconfig schema when adding LSP > change summary 1`] = ` +[ + { + "description": "Add @effect/language-service@workspace:* to devDependencies", + "file": "package.json", + }, + { + "description": "Update $schema in tsconfig; Add plugins array with @effect/language-service plugin", + "file": "tsconfig.json", + }, +] +`; + +exports[`Setup CLI > should replace existing tsconfig schema when adding LSP > package.json 1`] = ` +"{ + "name": "test-project", + "version": "1.0.0", + "dependencies": {}, +"devDependencies": { "@effect/language-service": "workspace:*" } +}" +`; + +exports[`Setup CLI > should replace existing tsconfig schema when adding LSP > tsconfig.json 1`] = ` +"{ + "$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json", + "compilerOptions": { + "strict": true, + "target": "ES2022", +"plugins": [ + { "name": "@effect/language-service" } +] + } +}" +`; + exports[`Setup CLI > should update LSP version when already installed with older version > change summary 1`] = ` [ { "description": "Update @effect/language-service from ^0.1.0 to ^0.2.0", "file": "package.json", }, + { + "description": "Add $schema to tsconfig", + "file": "tsconfig.json", + }, ] `; @@ -706,6 +757,21 @@ exports[`Setup CLI > should update LSP version when already installed with older }" `; +exports[`Setup CLI > should update LSP version when already installed with older version > tsconfig.json 1`] = ` +"{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "plugins": [ + { + "name": "@effect/language-service" + } + ] + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" +}" +`; + exports[`Setup CLI > should update outdated Effect Language Service section in AGENTS.md when enabling LSP > AGENTS.md 1`] = ` "# AGENTS.md @@ -730,7 +796,7 @@ exports[`Setup CLI > should update outdated Effect Language Service section in A "file": "package.json", }, { - "description": "Add plugins array with @effect/language-service plugin", + "description": "Add $schema to tsconfig; Add plugins array with @effect/language-service plugin", "file": "tsconfig.json", }, { @@ -757,6 +823,7 @@ exports[`Setup CLI > should update outdated Effect Language Service section in A "plugins": [ { "name": "@effect/language-service" } ] - } + }, +"$schema": "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" }" `; diff --git a/packages/language-service/package.json b/packages/language-service/package.json index 2f68883d..3391fc25 100644 --- a/packages/language-service/package.json +++ b/packages/language-service/package.json @@ -28,13 +28,13 @@ ], "scripts": { "build": "tsup", - "codegen": "node --import tsx ./scripts/generate-diagnostics-readme-table.ts", + "codegen": "node --import tsx ./scripts/codegen.ts", "dev": "tsup --watch", "clean": "rimraf dist build .tsbuildinfo", "lint": "eslint src test", "lint-fix": "eslint src test --fix", "check": "tsc -b tsconfig.json", - "check:codegen": "node --import tsx ./scripts/generate-diagnostics-readme-table.ts --check", + "check:codegen": "node --import tsx ./scripts/codegen.ts --check", "circular": "madge --extensions ts --circular --no-color --no-spinner --warning src", "test": "vitest", "test-update": "vitest --update", diff --git a/packages/language-service/scripts/codegen.ts b/packages/language-service/scripts/codegen.ts new file mode 100644 index 00000000..6c688f0c --- /dev/null +++ b/packages/language-service/scripts/codegen.ts @@ -0,0 +1,211 @@ +import { readFile, writeFile } from "node:fs/promises" +import { join, resolve } from "node:path" +import { fileURLToPath } from "node:url" +import { + type JsonSchema, + languageServicePluginAdditionalPropertiesJsonSchema +} from "../src/core/LanguageServicePluginOptions.js" +import { diagnostics } from "../src/diagnostics.js" + +class ReadmeMarkersNotFoundError extends Error { + constructor() { + super("README diagnostics table markers not found") + } +} + +class DiagnosticsTableOutOfDateError extends Error { + constructor() { + super("README diagnostics table is out of date. Run `pnpm codegen`.") + } +} + +class SchemaGenerationPathError extends Error { + constructor() { + super("Could not locate compilerOptions.plugins in tsconfig base schema") + } +} + +class GeneratedSchemaOutOfDateError extends Error { + constructor() { + super("schema.json is out of date. Run `pnpm codegen`.") + } +} + +const startMarker = "" +const endMarker = "" +const scriptDir = fileURLToPath(new URL(".", import.meta.url)) +const repoRoot = resolve(scriptDir, "../../..") +const readmePath = join(repoRoot, "README.md") +const generatedSchemaPath = join(repoRoot, "schema.json") +const baseSchemaPath = join(scriptDir, "tsconfig-base-schema.json") +const severityLevels = ["off", "error", "warning", "message", "suggestion"] as const + +const severityIcon = { + off: "βž–", + error: "❌", + warning: "⚠️", + message: "πŸ’¬", + suggestion: "πŸ’‘" +} as const + +const escapeTableCell = (value: string) => value.replace(/\|/g, "\\|").replace(/\n/g, " ") + +const renderTable = () => + [ + "| Diagnostic | Sev | Fix | Description | v3 | v4 |", + "| --- | --- | --- | --- | --- | --- |", + ...diagnostics + .slice() + .sort((a, b) => a.name.localeCompare(b.name)) + .map((diagnostic) => + `| \`${diagnostic.name}\` | ${severityIcon[diagnostic.severity]} | ${diagnostic.fixable ? "πŸ”§" : ""} | ${ + escapeTableCell(diagnostic.description) + } | ${diagnostic.supportedEffect.includes("v3") ? "βœ“" : ""} | ${ + diagnostic.supportedEffect.includes("v4") ? "βœ“" : "" + } |` + ), + "", + "`βž–` off by default, `❌` error, `⚠️` warning, `πŸ’¬` message, `πŸ’‘` suggestion, `πŸ”§` quick fix available" + ].join("\n") + +const cloneSchema = (schema: A): A => JSON.parse(JSON.stringify(schema)) as A + +const effectPluginDiagnosticSeverityDefinitionName = "effectLanguageServicePluginDiagnosticSeverityDefinition" + +const createDiagnosticSeveritySchema = (): JsonSchema => ({ + type: "object", + description: "Allows overriding the default severity for each Effect diagnostic across the project.", + additionalProperties: { + type: "string", + enum: severityLevels + }, + properties: Object.fromEntries( + diagnostics + .slice() + .sort((a, b) => a.name.localeCompare(b.name)) + .map((diagnostic) => [ + diagnostic.name, + { + type: "string", + enum: severityLevels, + default: diagnostic.severity, + description: `${diagnostic.description} Default severity: ${diagnostic.severity}.` + } satisfies JsonSchema + ]) + ) +}) + +const createEffectPluginSchema = (): JsonSchema => ({ + type: "object", + required: ["name"], + properties: { + name: { + type: "string", + enum: ["@effect/language-service"], + description: "Plugin name." + }, + ...languageServicePluginAdditionalPropertiesJsonSchema, + diagnosticSeverity: { + $ref: `#/definitions/${effectPluginDiagnosticSeverityDefinitionName}` + } + }, + additionalProperties: true +}) + +const createOtherPluginSchema = (schema: JsonSchema): JsonSchema => { + const next = cloneSchema(schema) + const nameSchema = next.properties?.name + return { + ...next, + properties: { + ...next.properties, + name: { + ...(nameSchema ?? { type: "string", description: "Plugin name." }), + not: { enum: ["@effect/language-service"] } + } + } + } +} + +const renderSchema = (baseSchemaContent: string): string => { + const schema = JSON.parse(baseSchemaContent) as { + definitions?: Record & { + compilerOptionsDefinition?: { + properties?: { + compilerOptions?: { + properties?: { + plugins?: JsonSchema + } + } + } + } + } + } + const plugins = schema.definitions?.compilerOptionsDefinition?.properties?.compilerOptions?.properties?.plugins + + if (!plugins?.items) { + throw new SchemaGenerationPathError() + } + + schema.definitions ??= {} + schema.definitions[effectPluginDiagnosticSeverityDefinitionName] = createDiagnosticSeveritySchema() + + const otherPluginSchema = createOtherPluginSchema(plugins.items) + plugins.items = { + anyOf: [ + createEffectPluginSchema(), + otherPluginSchema + ] + } + + return `${JSON.stringify(schema, null, 2)}\n` +} + +async function readIfExists(filePath: string): Promise { + try { + return await readFile(filePath, "utf8") + } catch (error) { + if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") { + return undefined + } + throw error + } +} + +async function main() { + const readme = await readFile(readmePath, "utf8") + const startIndex = readme.indexOf(startMarker) + const endIndex = readme.indexOf(endMarker) + + if (startIndex === -1 || endIndex === -1 || startIndex > endIndex) { + throw new ReadmeMarkersNotFoundError() + } + + const block = `${startMarker}\n${renderTable()}\n${endMarker}` + const updatedReadme = readme.slice(0, startIndex) + block + readme.slice(endIndex + endMarker.length) + const baseSchema = await readFile(baseSchemaPath, "utf8") + const updatedSchema = renderSchema(baseSchema) + + if (process.argv.includes("--check")) { + if (updatedReadme !== readme) { + throw new DiagnosticsTableOutOfDateError() + } + const existingSchema = await readIfExists(generatedSchemaPath) + if (existingSchema !== updatedSchema) { + throw new GeneratedSchemaOutOfDateError() + } + return + } + + if (updatedReadme !== readme) { + await writeFile(readmePath, updatedReadme) + } + if (updatedSchema !== await readIfExists(generatedSchemaPath)) { + await writeFile(generatedSchemaPath, updatedSchema) + } +} + +main().catch((error) => { + console.error(error instanceof Error ? error.message : String(error)) + process.exit(1) +}) diff --git a/packages/language-service/scripts/generate-diagnostics-readme-table.ts b/packages/language-service/scripts/generate-diagnostics-readme-table.ts deleted file mode 100644 index 9a88325c..00000000 --- a/packages/language-service/scripts/generate-diagnostics-readme-table.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as NodeServices from "@effect/platform-node/NodeServices" -import * as Cause from "effect/Cause" -import * as Data from "effect/Data" -import * as Effect from "effect/Effect" -import * as Exit from "effect/Exit" -import * as FileSystem from "effect/FileSystem" -import { pipe } from "effect/Function" -import * as Path from "effect/Path" -import { fileURLToPath } from "node:url" -import { diagnostics } from "../src/diagnostics.js" - -class ReadmeMarkersNotFoundError extends Data.TaggedError("ReadmeMarkersNotFoundError")<{}> { - get message(): string { - return "README diagnostics table markers not found" - } -} - -class DiagnosticsTableOutOfDateError extends Data.TaggedError("DiagnosticsTableOutOfDateError")<{}> { - get message(): string { - return "README diagnostics table is out of date. Run `pnpm codegen`." - } -} - -const startMarker = "" -const endMarker = "" -const scriptDir = fileURLToPath(new URL(".", import.meta.url)) - -const severityIcon = { - off: "βž–", - error: "❌", - warning: "⚠️", - message: "πŸ’¬", - suggestion: "πŸ’‘" -} as const - -const escapeTableCell = (value: string) => value.replaceAll("|", "\\|").replaceAll("\n", " ") - -const renderTable = () => - [ - "| Diagnostic | Sev | Fix | Description | v3 | v4 |", - "| --- | --- | --- | --- | --- | --- |", - ...diagnostics - .slice() - .sort((a, b) => a.name.localeCompare(b.name)) - .map((diagnostic) => - `| \`${diagnostic.name}\` | ${severityIcon[diagnostic.severity]} | ${diagnostic.fixable ? "πŸ”§" : ""} | ${ - escapeTableCell(diagnostic.description) - } | ${diagnostic.supportedEffect.includes("v3") ? "βœ“" : ""} | ${ - diagnostic.supportedEffect.includes("v4") ? "βœ“" : "" - } |` - ), - "", - "`βž–` off by default, `❌` error, `⚠️` warning, `πŸ’¬` message, `πŸ’‘` suggestion, `πŸ”§` quick fix available" - ].join("\n") - -const program = Effect.gen(function*() { - const fs = yield* FileSystem.FileSystem - const path = yield* Path.Path - const repoRoot = path.resolve(scriptDir, "../../..") - const readmePath = path.join(repoRoot, "README.md") - const readme = yield* fs.readFileString(readmePath) - const startIndex = readme.indexOf(startMarker) - const endIndex = readme.indexOf(endMarker) - - if (startIndex === -1 || endIndex === -1 || startIndex > endIndex) { - return yield* new ReadmeMarkersNotFoundError() - } - - const block = `${startMarker}\n${renderTable()}\n${endMarker}` - const updatedReadme = readme.slice(0, startIndex) + block + readme.slice(endIndex + endMarker.length) - - if (process.argv.includes("--check")) { - if (updatedReadme !== readme) { - return yield* new DiagnosticsTableOutOfDateError() - } - return - } - - if (updatedReadme !== readme) { - yield* fs.writeFileString(readmePath, updatedReadme) - } -}) - -pipe(program, Effect.provide(NodeServices.layer), Effect.runPromiseExit).then((exit) => { - if (Exit.isFailure(exit)) { - console.error(Cause.pretty(exit.cause)) - process.exit(1) - } -}) diff --git a/packages/language-service/scripts/tsconfig-base-schema.json b/packages/language-service/scripts/tsconfig-base-schema.json new file mode 100644 index 00000000..c7dcbff7 --- /dev/null +++ b/packages/language-service/scripts/tsconfig-base-schema.json @@ -0,0 +1,1383 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$comment": "Note that this schema uses 'null' in various places. The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058)", + "allowTrailingCommas": true, + "allOf": [ + { + "$ref": "#/definitions/compilerOptionsDefinition" + }, + { + "$ref": "#/definitions/compileOnSaveDefinition" + }, + { + "$ref": "#/definitions/typeAcquisitionDefinition" + }, + { + "$ref": "#/definitions/extendsDefinition" + }, + { + "$ref": "#/definitions/watchOptionsDefinition" + }, + { + "$ref": "#/definitions/buildOptionsDefinition" + }, + { + "$ref": "#/definitions/tsNodeDefinition" + }, + { + "anyOf": [ + { + "$ref": "#/definitions/filesDefinition" + }, + { + "$ref": "#/definitions/excludeDefinition" + }, + { + "$ref": "#/definitions/includeDefinition" + }, + { + "$ref": "#/definitions/referencesDefinition" + } + ] + } + ], + "definitions": { + "//": { + "explainer": "https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#overview", + "reference": "https://www.typescriptlang.org/tsconfig", + "reference metadata": "https://github.com/microsoft/TypeScript-Website/blob/v2/packages/tsconfig-reference/scripts/tsconfigRules.ts" + }, + "filesDefinition": { + "properties": { + "files": { + "description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + }, + "excludeDefinition": { + "properties": { + "exclude": { + "description": "Specifies a list of files to be excluded from compilation. The 'exclude' property only affects the files included via the 'include' property and not the 'files' property. Glob patterns require TypeScript version 2.0 or later.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + }, + "includeDefinition": { + "properties": { + "include": { + "description": "Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + }, + "compileOnSaveDefinition": { + "properties": { + "compileOnSave": { + "description": "Enable Compile-on-Save for this project.", + "type": ["boolean", "null"] + } + } + }, + "extendsDefinition": { + "properties": { + "extends": { + "description": "Path to base configuration file to inherit from (requires TypeScript version 2.1 or later), or array of base files, with the rightmost files having the greater priority (requires TypeScript version 5.0 or later).", + "oneOf": [ + { + "default": "", + "type": "string" + }, + { + "default": [], + "items": { + "type": "string" + }, + "type": "array" + } + ] + } + } + }, + "buildOptionsDefinition": { + "properties": { + "buildOptions": { + "properties": { + "dry": { + "description": "~", + "type": ["boolean", "null"], + "default": false + }, + "force": { + "description": "Build all projects, including those that appear to be up to date", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Build all projects, including those that appear to be up to date\n\nSee more: https://www.typescriptlang.org/tsconfig#force" + }, + "verbose": { + "description": "Enable verbose logging", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable verbose logging\n\nSee more: https://www.typescriptlang.org/tsconfig#verbose" + }, + "incremental": { + "description": "Save .tsbuildinfo files to allow for incremental compilation of projects.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Save .tsbuildinfo files to allow for incremental compilation of projects.\n\nSee more: https://www.typescriptlang.org/tsconfig#incremental" + }, + "assumeChangesOnlyAffectDirectDependencies": { + "description": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.\n\nSee more: https://www.typescriptlang.org/tsconfig#assumeChangesOnlyAffectDirectDependencies" + }, + "traceResolution": { + "description": "Log paths used during the `moduleResolution` process.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Log paths used during the `moduleResolution` process.\n\nSee more: https://www.typescriptlang.org/tsconfig#traceResolution" + } + } + } + } + }, + "watchOptionsDefinition": { + "properties": { + "watchOptions": { + "type": ["object", "null"], + "description": "Settings for the watch mode in TypeScript.", + "properties": { + "force": { + "description": "~", + "type": ["string", "null"] + }, + "watchFile": { + "description": "Specify how the TypeScript watch mode works.", + "type": ["string", "null"], + "markdownDescription": "Specify how the TypeScript watch mode works.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchFile" + }, + "watchDirectory": { + "description": "Specify how directories are watched on systems that lack recursive file-watching functionality.", + "type": ["string", "null"], + "markdownDescription": "Specify how directories are watched on systems that lack recursive file-watching functionality.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchDirectory" + }, + "fallbackPolling": { + "description": "Specify what approach the watcher should use if the system runs out of native file watchers.", + "type": ["string", "null"], + "markdownDescription": "Specify what approach the watcher should use if the system runs out of native file watchers.\n\nSee more: https://www.typescriptlang.org/tsconfig#fallbackPolling" + }, + "synchronousWatchDirectory": { + "description": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.", + "type": ["boolean", "null"], + "markdownDescription": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.\n\nSee more: https://www.typescriptlang.org/tsconfig#synchronousWatchDirectory" + }, + "excludeFiles": { + "description": "Remove a list of files from the watch mode's processing.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Remove a list of files from the watch mode's processing.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeFiles" + }, + "excludeDirectories": { + "description": "Remove a list of directories from the watch process.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Remove a list of directories from the watch process.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeDirectories" + } + } + } + } + }, + "compilerOptionsDefinition": { + "properties": { + "compilerOptions": { + "type": ["object", "null"], + "description": "Instructs the TypeScript compiler how to compile .ts files.", + "properties": { + "allowArbitraryExtensions": { + "description": "Enable importing files with any extension, provided a declaration file is present.", + "type": ["boolean", "null"], + "markdownDescription": "Enable importing files with any extension, provided a declaration file is present.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowArbitraryExtensions" + }, + "allowImportingTsExtensions": { + "description": "Allow imports to include TypeScript file extensions. Requires `--moduleResolution bundler` and either `--noEmit` or `--emitDeclarationOnly` to be set.", + "type": ["boolean", "null"], + "markdownDescription": "Allow imports to include TypeScript file extensions. Requires `--moduleResolution bundler` and either `--noEmit` or `--emitDeclarationOnly` to be set.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions" + }, + "charset": { + "description": "No longer supported. In early versions, manually set the text encoding for reading files.", + "type": ["string", "null"], + "markdownDescription": "No longer supported. In early versions, manually set the text encoding for reading files.\n\nSee more: https://www.typescriptlang.org/tsconfig#charset" + }, + "composite": { + "description": "Enable constraints that allow a TypeScript project to be used with project references.", + "type": ["boolean", "null"], + "default": true, + "markdownDescription": "Enable constraints that allow a TypeScript project to be used with project references.\n\nSee more: https://www.typescriptlang.org/tsconfig#composite" + }, + "customConditions": { + "description": "Conditions to set in addition to the resolver-specific defaults when resolving imports.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Conditions to set in addition to the resolver-specific defaults when resolving imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#customConditions" + }, + "declaration": { + "description": "Generate .d.ts files from TypeScript and JavaScript files in your project.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Generate .d.ts files from TypeScript and JavaScript files in your project.\n\nSee more: https://www.typescriptlang.org/tsconfig#declaration" + }, + "declarationDir": { + "description": "Specify the output directory for generated declaration files.", + "type": ["string", "null"], + "markdownDescription": "Specify the output directory for generated declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationDir" + }, + "diagnostics": { + "description": "Output compiler performance information after building.", + "type": ["boolean", "null"], + "markdownDescription": "Output compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#diagnostics" + }, + "disableReferencedProjectLoad": { + "description": "Reduce the number of projects loaded automatically by TypeScript.", + "type": ["boolean", "null"], + "markdownDescription": "Reduce the number of projects loaded automatically by TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableReferencedProjectLoad" + }, + "noPropertyAccessFromIndexSignature": { + "description": "Enforces using indexed accessors for keys declared using an indexed type.", + "type": ["boolean", "null"], + "markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type.\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature" + }, + "emitBOM": { + "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitBOM" + }, + "emitDeclarationOnly": { + "description": "Only output d.ts files and not JavaScript files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Only output d.ts files and not JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly" + }, + "erasableSyntaxOnly": { + "description": "Do not allow runtime constructs that are not part of ECMAScript.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Do not allow runtime constructs that are not part of ECMAScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#erasableSyntaxOnly" + }, + "exactOptionalPropertyTypes": { + "description": "Interpret optional property types as written, rather than adding `undefined`.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Interpret optional property types as written, rather than adding `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes" + }, + "incremental": { + "description": "Enable incremental compilation. Requires TypeScript version 3.4 or later.", + "type": ["boolean", "null"] + }, + "tsBuildInfoFile": { + "description": "Specify the path to .tsbuildinfo incremental compilation file.", + "default": ".tsbuildinfo", + "type": ["string", "null"], + "markdownDescription": "Specify the path to .tsbuildinfo incremental compilation file.\n\nSee more: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile" + }, + "inlineSourceMap": { + "description": "Include sourcemap files inside the emitted JavaScript.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Include sourcemap files inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSourceMap" + }, + "inlineSources": { + "description": "Include source code in the sourcemaps inside the emitted JavaScript.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Include source code in the sourcemaps inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSources" + }, + "jsx": { + "description": "Specify what JSX code is generated.", + "enum": [ + "preserve", + "react", + "react-jsx", + "react-jsxdev", + "react-native" + ], + "markdownDescription": "Specify what JSX code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsx" + }, + "reactNamespace": { + "description": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.", + "type": ["string", "null"], + "default": "React", + "markdownDescription": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.\n\nSee more: https://www.typescriptlang.org/tsconfig#reactNamespace" + }, + "jsxFactory": { + "description": "Specify the JSX factory function used when targeting React JSX emit, e.g. `React.createElement` or `h`.", + "type": ["string", "null"], + "default": "React.createElement", + "markdownDescription": "Specify the JSX factory function used when targeting React JSX emit, e.g. `React.createElement` or `h`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFactory" + }, + "jsxFragmentFactory": { + "description": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. `React.Fragment` or `Fragment`.", + "type": ["string", "null"], + "default": "React.Fragment", + "markdownDescription": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. `React.Fragment` or `Fragment`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFragmentFactory" + }, + "jsxImportSource": { + "description": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.", + "type": ["string", "null"], + "default": "react", + "markdownDescription": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxImportSource" + }, + "listFiles": { + "description": "Print all of the files read during the compilation.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Print all of the files read during the compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listFiles" + }, + "mapRoot": { + "description": "Specify the location where debugger should locate map files instead of generated locations.", + "type": ["string", "null"], + "markdownDescription": "Specify the location where debugger should locate map files instead of generated locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#mapRoot" + }, + "module": { + "description": "Specify what module code is generated.", + "type": ["string", "null"], + "anyOf": [ + { + "enum": [ + "commonjs", + "amd", + "system", + "umd", + "es6", + "es2015", + "es2020", + "esnext", + "none", + "es2022", + "node16", + "node18", + "node20", + "nodenext", + "preserve" + ] + }, + { + "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee](1[68]|20)|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee]|[Pp][Rr][Ee][Ss][Ee][Rr][Vv][Ee])$" + } + ], + "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module" + }, + "moduleResolution": { + "description": "Specify how TypeScript looks up a file from a given module specifier.", + "type": ["string", "null"], + "anyOf": [ + { + "enum": [ + "classic", + "node", + "node10", + "node16", + "nodenext", + "bundler" + ], + "markdownEnumDescriptions": [ + "It’s recommended to use `\"node16\"` instead", + "Deprecated, use `\"node10\"` in TypeScript 5.0+ instead", + "It’s recommended to use `\"node16\"` instead", + "This is the recommended setting for libraries and Node.js applications", + "This is the recommended setting for libraries and Node.js applications", + "This is the recommended setting in TypeScript 5.0+ for applications that use a bundler" + ] + }, + { + "pattern": "^(([Nn]ode)|([Nn]ode1[06])|([Nn]ode[Nn]ext)|([Cc]lassic)|([Bb]undler))$" + } + ], + "markdownDescription": "Specify how TypeScript looks up a file from a given module specifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleResolution" + }, + "moduleSuffixes": { + "description": "List of file name suffixes to search when resolving a module.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "List of file name suffixes to search when resolving a module.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleSuffixes" + }, + "newLine": { + "description": "Set the newline character for emitting files.", + "type": ["string", "null"], + "default": "lf", + "anyOf": [ + { + "enum": ["crlf", "lf"] + }, + { + "pattern": "^(CRLF|LF|crlf|lf)$" + } + ], + "markdownDescription": "Set the newline character for emitting files.\n\nSee more: https://www.typescriptlang.org/tsconfig#newLine" + }, + "noEmit": { + "description": "Disable emitting files from a compilation.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable emitting files from a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmit" + }, + "noEmitHelpers": { + "description": "Disable generating custom helper functions like `__extends` in compiled output.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable generating custom helper functions like `__extends` in compiled output.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitHelpers" + }, + "noEmitOnError": { + "description": "Disable emitting files if any type checking errors are reported.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable emitting files if any type checking errors are reported.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitOnError" + }, + "noImplicitAny": { + "description": "Enable error reporting for expressions and declarations with an implied `any` type.", + "type": ["boolean", "null"], + "markdownDescription": "Enable error reporting for expressions and declarations with an implied `any` type.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitAny" + }, + "noImplicitThis": { + "description": "Enable error reporting when `this` is given the type `any`.", + "type": ["boolean", "null"], + "markdownDescription": "Enable error reporting when `this` is given the type `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitThis" + }, + "noUnusedLocals": { + "description": "Enable error reporting when local variables aren't read.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable error reporting when local variables aren't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedLocals" + }, + "noUnusedParameters": { + "description": "Raise an error when a function parameter isn't read.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Raise an error when a function parameter isn't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedParameters" + }, + "noLib": { + "description": "Disable including any library files, including the default lib.d.ts.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable including any library files, including the default lib.d.ts.\n\nSee more: https://www.typescriptlang.org/tsconfig#noLib" + }, + "noResolve": { + "description": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.\n\nSee more: https://www.typescriptlang.org/tsconfig#noResolve" + }, + "noStrictGenericChecks": { + "description": "Disable strict checking of generic signatures in function types.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable strict checking of generic signatures in function types.\n\nSee more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks" + }, + "out": { + "description": "Deprecated setting. Use `outFile` instead.", + "type": ["string", "null"], + "markdownDescription": "Deprecated setting. Use `outFile` instead.\n\nSee more: https://www.typescriptlang.org/tsconfig#out" + }, + "skipDefaultLibCheck": { + "description": "Skip type checking .d.ts files that are included with TypeScript.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Skip type checking .d.ts files that are included with TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipDefaultLibCheck" + }, + "skipLibCheck": { + "description": "Skip type checking all .d.ts files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Skip type checking all .d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipLibCheck" + }, + "outFile": { + "description": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.", + "type": ["string", "null"], + "markdownDescription": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.\n\nSee more: https://www.typescriptlang.org/tsconfig#outFile" + }, + "outDir": { + "description": "Specify an output folder for all emitted files.", + "type": ["string", "null"], + "markdownDescription": "Specify an output folder for all emitted files.\n\nSee more: https://www.typescriptlang.org/tsconfig#outDir" + }, + "preserveConstEnums": { + "description": "Disable erasing `const enum` declarations in generated code.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable erasing `const enum` declarations in generated code.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveConstEnums" + }, + "preserveSymlinks": { + "description": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveSymlinks" + }, + "preserveValueImports": { + "description": "Preserve unused imported values in the JavaScript output that would otherwise be removed.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Preserve unused imported values in the JavaScript output that would otherwise be removed.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveValueImports" + }, + "preserveWatchOutput": { + "description": "Disable wiping the console in watch mode.", + "type": ["boolean", "null"], + "markdownDescription": "Disable wiping the console in watch mode.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveWatchOutput" + }, + "pretty": { + "description": "Enable color and formatting in TypeScript's output to make compiler errors easier to read.", + "type": ["boolean", "null"], + "default": true, + "markdownDescription": "Enable color and formatting in TypeScript's output to make compiler errors easier to read.\n\nSee more: https://www.typescriptlang.org/tsconfig#pretty" + }, + "removeComments": { + "description": "Disable emitting comments.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments" + }, + "rewriteRelativeImportExtensions": { + "description": "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions" + }, + "rootDir": { + "description": "Specify the root folder within your source files.", + "type": ["string", "null"], + "markdownDescription": "Specify the root folder within your source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDir" + }, + "isolatedModules": { + "description": "Ensure that each file can be safely transpiled without relying on other imports.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Ensure that each file can be safely transpiled without relying on other imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedModules" + }, + "sourceMap": { + "description": "Create source map files for emitted JavaScript files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Create source map files for emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceMap" + }, + "sourceRoot": { + "description": "Specify the root path for debuggers to find the reference source code.", + "type": ["string", "null"], + "markdownDescription": "Specify the root path for debuggers to find the reference source code.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceRoot" + }, + "suppressExcessPropertyErrors": { + "description": "Disable reporting of excess property errors during the creation of object literals.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable reporting of excess property errors during the creation of object literals.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors" + }, + "suppressImplicitAnyIndexErrors": { + "description": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors" + }, + "stripInternal": { + "description": "Disable emitting declarations that have `@internal` in their JSDoc comments.", + "type": ["boolean", "null"], + "markdownDescription": "Disable emitting declarations that have `@internal` in their JSDoc comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#stripInternal" + }, + "target": { + "description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.", + "type": ["string", "null"], + "default": "es3", + "anyOf": [ + { + "enum": [ + "es3", + "es5", + "es6", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020", + "es2021", + "es2022", + "es2023", + "es2024", + "esnext" + ] + }, + { + "pattern": "^([Ee][Ss]([356]|(20(1[56789]|2[01234]))|[Nn][Ee][Xx][Tt]))$" + } + ], + "markdownDescription": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.\n\nSee more: https://www.typescriptlang.org/tsconfig#target" + }, + "useUnknownInCatchVariables": { + "description": "Default catch clause variables as `unknown` instead of `any`.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Default catch clause variables as `unknown` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables" + }, + "watch": { + "description": "Watch input files.", + "type": ["boolean", "null"] + }, + "fallbackPolling": { + "description": "Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. Requires TypeScript version 3.8 or later.", + "enum": [ + "fixedPollingInterval", + "priorityPollingInterval", + "dynamicPriorityPolling", + "fixedInterval", + "priorityInterval", + "dynamicPriority", + "fixedChunkSize" + ] + }, + "watchDirectory": { + "description": "Specify the strategy for watching directories under systems that lack recursive file-watching functionality. Requires TypeScript version 3.8 or later.", + "enum": [ + "useFsEvents", + "fixedPollingInterval", + "dynamicPriorityPolling", + "fixedChunkSizePolling" + ], + "default": "useFsEvents" + }, + "watchFile": { + "description": "Specify the strategy for watching individual files. Requires TypeScript version 3.8 or later.", + "enum": [ + "fixedPollingInterval", + "priorityPollingInterval", + "dynamicPriorityPolling", + "useFsEvents", + "useFsEventsOnParentDirectory", + "fixedChunkSizePolling" + ], + "default": "useFsEvents" + }, + "experimentalDecorators": { + "description": "Enable experimental support for legacy experimental decorators.", + "type": ["boolean", "null"], + "markdownDescription": "Enable experimental support for legacy experimental decorators.\n\nSee more: https://www.typescriptlang.org/tsconfig#experimentalDecorators" + }, + "emitDecoratorMetadata": { + "description": "Emit design-type metadata for decorated declarations in source files.", + "type": ["boolean", "null"], + "markdownDescription": "Emit design-type metadata for decorated declarations in source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata" + }, + "allowUnusedLabels": { + "description": "Disable error reporting for unused labels.", + "type": ["boolean", "null"], + "markdownDescription": "Disable error reporting for unused labels.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnusedLabels" + }, + "noImplicitReturns": { + "description": "Enable error reporting for codepaths that do not explicitly return in a function.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable error reporting for codepaths that do not explicitly return in a function.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitReturns" + }, + "noUncheckedIndexedAccess": { + "description": "Add `undefined` to a type when accessed using an index.", + "type": ["boolean", "null"], + "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess" + }, + "noFallthroughCasesInSwitch": { + "description": "Enable error reporting for fallthrough cases in switch statements.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable error reporting for fallthrough cases in switch statements.\n\nSee more: https://www.typescriptlang.org/tsconfig#noFallthroughCasesInSwitch" + }, + "noImplicitOverride": { + "description": "Ensure overriding members in derived classes are marked with an override modifier.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Ensure overriding members in derived classes are marked with an override modifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitOverride" + }, + "allowUnreachableCode": { + "description": "Disable error reporting for unreachable code.", + "type": ["boolean", "null"], + "markdownDescription": "Disable error reporting for unreachable code.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnreachableCode" + }, + "forceConsistentCasingInFileNames": { + "description": "Ensure that casing is correct in imports.", + "type": ["boolean", "null"], + "default": true, + "markdownDescription": "Ensure that casing is correct in imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames" + }, + "generateCpuProfile": { + "description": "Emit a v8 CPU profile of the compiler run for debugging.", + "type": ["string", "null"], + "default": "profile.cpuprofile", + "markdownDescription": "Emit a v8 CPU profile of the compiler run for debugging.\n\nSee more: https://www.typescriptlang.org/tsconfig#generateCpuProfile" + }, + "baseUrl": { + "description": "Specify the base directory to resolve non-relative module names.", + "type": ["string", "null"], + "markdownDescription": "Specify the base directory to resolve non-relative module names.\n\nSee more: https://www.typescriptlang.org/tsconfig#baseUrl" + }, + "paths": { + "description": "Specify a set of entries that re-map imports to additional lookup locations.", + "type": ["object", "null"], + "additionalProperties": { + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string", + "description": "Path mapping to be computed relative to baseUrl option." + } + }, + "markdownDescription": "Specify a set of entries that re-map imports to additional lookup locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#paths" + }, + "plugins": { + "description": "Specify a list of language service plugins to include.", + "type": ["array", "null"], + "items": { + "type": "object", + "properties": { + "name": { + "description": "Plugin name.", + "type": "string" + } + } + }, + "markdownDescription": "Specify a list of language service plugins to include.\n\nSee more: https://www.typescriptlang.org/tsconfig#plugins" + }, + "rootDirs": { + "description": "Allow multiple folders to be treated as one when resolving modules.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Allow multiple folders to be treated as one when resolving modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDirs" + }, + "typeRoots": { + "description": "Specify multiple folders that act like `./node_modules/@types`.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Specify multiple folders that act like `./node_modules/@types`.\n\nSee more: https://www.typescriptlang.org/tsconfig#typeRoots" + }, + "types": { + "description": "Specify type package names to be included without being referenced in a source file.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Specify type package names to be included without being referenced in a source file.\n\nSee more: https://www.typescriptlang.org/tsconfig#types" + }, + "traceResolution": { + "description": "Log paths used during the `moduleResolution` process.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Log paths used during the `moduleResolution` process.\n\nSee more: https://www.typescriptlang.org/tsconfig#traceResolution" + }, + "allowJs": { + "description": "Allow JavaScript files to be a part of your program. Use the `checkJs` option to get errors from these files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Allow JavaScript files to be a part of your program. Use the `checkJs` option to get errors from these files.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowJs" + }, + "noErrorTruncation": { + "description": "Disable truncating types in error messages.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable truncating types in error messages.\n\nSee more: https://www.typescriptlang.org/tsconfig#noErrorTruncation" + }, + "allowSyntheticDefaultImports": { + "description": "Allow `import x from y` when a module doesn't have a default export.", + "type": ["boolean", "null"], + "markdownDescription": "Allow `import x from y` when a module doesn't have a default export.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports" + }, + "noImplicitUseStrict": { + "description": "Disable adding `use strict` directives in emitted JavaScript files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable adding `use strict` directives in emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict" + }, + "listEmittedFiles": { + "description": "Print the names of emitted files after a compilation.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Print the names of emitted files after a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listEmittedFiles" + }, + "disableSizeLimit": { + "description": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSizeLimit" + }, + "lib": { + "description": "Specify a set of bundled library declaration files that describe the target runtime environment.", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string", + "anyOf": [ + { + "enum": [ + "ES5", + "ES6", + "ES2015", + "ES2015.Collection", + "ES2015.Core", + "ES2015.Generator", + "ES2015.Iterable", + "ES2015.Promise", + "ES2015.Proxy", + "ES2015.Reflect", + "ES2015.Symbol.WellKnown", + "ES2015.Symbol", + "ES2016", + "ES2016.Array.Include", + "ES2017", + "ES2017.Intl", + "ES2017.Object", + "ES2017.SharedMemory", + "ES2017.String", + "ES2017.TypedArrays", + "ES2017.ArrayBuffer", + "ES2018", + "ES2018.AsyncGenerator", + "ES2018.AsyncIterable", + "ES2018.Intl", + "ES2018.Promise", + "ES2018.Regexp", + "ES2019", + "ES2019.Array", + "ES2019.Intl", + "ES2019.Object", + "ES2019.String", + "ES2019.Symbol", + "ES2020", + "ES2020.BigInt", + "ES2020.Promise", + "ES2020.String", + "ES2020.Symbol.WellKnown", + "ESNext", + "ESNext.Array", + "ESNext.AsyncIterable", + "ESNext.BigInt", + "ESNext.Collection", + "ESNext.Intl", + "ESNext.Iterator", + "ESNext.Object", + "ESNext.Promise", + "ESNext.Regexp", + "ESNext.String", + "ESNext.Symbol", + "DOM", + "DOM.AsyncIterable", + "DOM.Iterable", + "ScriptHost", + "WebWorker", + "WebWorker.AsyncIterable", + "WebWorker.ImportScripts", + "Webworker.Iterable", + "ES7", + "ES2021", + "ES2020.SharedMemory", + "ES2020.Intl", + "ES2020.Date", + "ES2020.Number", + "ES2021.Promise", + "ES2021.String", + "ES2021.WeakRef", + "ESNext.WeakRef", + "ES2021.Intl", + "ES2022", + "ES2022.Array", + "ES2022.Error", + "ES2022.Intl", + "ES2022.Object", + "ES2022.String", + "ES2022.SharedMemory", + "ES2022.RegExp", + "ES2023", + "ES2023.Array", + "ES2024", + "ES2024.ArrayBuffer", + "ES2024.Collection", + "ES2024.Object", + "ES2024.Promise", + "ES2024.Regexp", + "ES2024.SharedMemory", + "ES2024.String", + "Decorators", + "Decorators.Legacy", + "ES2017.Date", + "ES2023.Collection", + "ESNext.Decorators", + "ESNext.Disposable", + "ESNext.Error", + "ESNext.Sharedmemory" + ] + }, + { + "pattern": "^[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]7$" + }, + { + "pattern": "^[Ee][Ss]2015(\\.([Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Cc][Oo][Rr][Ee]|[Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Pp][Rr][Oo][Xx][Yy]|[Rr][Ee][Ff][Ll][Ee][Cc][Tt]|[Ss][Yy][Mm][Bb][Oo][Ll]\\.[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$" + }, + { + "pattern": "^[Ee][Ss]2016(\\.[Aa][Rr][Rr][Aa][Yy]\\.[Ii][Nn][Cc][Ll][Uu][Dd][Ee])?$" + }, + { + "pattern": "^[Ee][Ss]2017(\\.([Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Tt][Yy][Pp][Ee][Dd][Aa][Rr][Rr][Aa][Yy][Ss]|[Dd][Aa][Tt][Ee]|[Aa][Rr][Rr][Aa][Yy][Bb][Uu][Ff][Ff][Ee][Rr]))?$" + }, + { + "pattern": "^[Ee][Ss]2018(\\.([Aa][Ss][Yy][Nn][Cc][Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Rr][Ee][Gg][Ee][Xx][Pp]))?$" + }, + { + "pattern": "^[Ee][Ss]2019(\\.([Aa][Rr][Rr][Aa][Yy]|[Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$" + }, + { + "pattern": "^[Ee][Ss]2020(\\.([Bb][Ii][Gg][Ii][Nn][Tt]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]\\.[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ii][Nn][Tt][Ll]|[Dd][Aa][Tt][Ee]|[Nn][Uu][Mm][Bb][Ee][Rr]))?$" + }, + { + "pattern": "^[Ee][Ss]2021(\\.([Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]))?$" + }, + { + "pattern": "^[Ee][Ss]2022(\\.([Aa][Rr][Rr][Aa][Yy]|[Ee][Rr][Rr][Oo][Rr]|[Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Rr][Ee][Gg][Ee][Xx][Pp]))?$" + }, + { + "pattern": "^[Ee][Ss]2023(\\.([Aa][Rr][Rr][Aa][Yy]|[Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]))?$" + }, + { + "pattern": "^[Ee][Ss]2024(\\.([Aa][Rr][Rr][Aa][Yy][Bb][Uu][Ff][Ff][Ee][Rr]|[Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Rr][Ee][Gg][Ee][Xx][Pp]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ss][Tt][Rr][Ii][Nn][Gg]))?$" + }, + { + "pattern": "^[Ee][Ss][Nn][Ee][Xx][Tt](\\.([Aa][Rr][Rr][Aa][Yy]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Bb][Ii][Gg][Ii][Nn][Tt]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]|[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss]|[Dd][Ii][Ss][Pp][Oo][Ss][Aa][Bb][Ll][Ee]))?$" + }, + { + "pattern": "^[Dd][Oo][Mm](\\.([Aa][Ss][Yy][Nn][Cc])?[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee])?$" + }, + { + "pattern": "^[Ss][Cc][Rr][Ii][Pp][Tt][Hh][Oo][Ss][Tt]$" + }, + { + "pattern": "^[Ww][Ee][Bb][Ww][Oo][Rr][Kk][Ee][Rr](\\.([Ii][Mm][Pp][Oo][Rr][Tt][Ss][Cc][Rr][Ii][Pp][Tt][Ss]|([Aa][Ss][Yy][Nn][Cc])?[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]))?$" + }, + { + "pattern": "^[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss](\\.([Ll][Ee][Gg][Aa][Cc][Yy]))?$" + } + ] + }, + "markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib" + }, + "libReplacement": { + "description": "Enable lib replacement.", + "type": ["boolean", "null"], + "default": true, + "markdownDescription": "Enable lib replacement.\n\nSee more: https://www.typescriptlang.org/tsconfig#libReplacement" + }, + "moduleDetection": { + "description": "Control what method is used to detect module-format JS files.", + "enum": ["auto", "legacy", "force"], + "markdownDescription": "Control what method is used to detect module-format JS files.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleDetection" + }, + "strictNullChecks": { + "description": "When type checking, take into account `null` and `undefined`.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "When type checking, take into account `null` and `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictNullChecks" + }, + "maxNodeModuleJsDepth": { + "description": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.", + "type": ["number", "null"], + "default": 0, + "markdownDescription": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.\n\nSee more: https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth" + }, + "importHelpers": { + "description": "Allow importing helper functions from tslib once per project, instead of including them per-file.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Allow importing helper functions from tslib once per project, instead of including them per-file.\n\nSee more: https://www.typescriptlang.org/tsconfig#importHelpers" + }, + "importsNotUsedAsValues": { + "description": "Specify emit/checking behavior for imports that are only used for types.", + "default": "remove", + "enum": ["remove", "preserve", "error"], + "markdownDescription": "Specify emit/checking behavior for imports that are only used for types.\n\nSee more: https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues" + }, + "alwaysStrict": { + "description": "Ensure `use strict` is always emitted.", + "type": ["boolean", "null"], + "markdownDescription": "Ensure `use strict` is always emitted.\n\nSee more: https://www.typescriptlang.org/tsconfig#alwaysStrict" + }, + "strict": { + "description": "Enable all strict type-checking options.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable all strict type-checking options.\n\nSee more: https://www.typescriptlang.org/tsconfig#strict" + }, + "strictBindCallApply": { + "description": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBindCallApply" + }, + "downlevelIteration": { + "description": "Emit more compliant, but verbose and less performant JavaScript for iteration.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Emit more compliant, but verbose and less performant JavaScript for iteration.\n\nSee more: https://www.typescriptlang.org/tsconfig#downlevelIteration" + }, + "checkJs": { + "description": "Enable error reporting in type-checked JavaScript files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable error reporting in type-checked JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#checkJs" + }, + "strictFunctionTypes": { + "description": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes" + }, + "strictPropertyInitialization": { + "description": "Check for class properties that are declared but not set in the constructor.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization" + }, + "esModuleInterop": { + "description": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.\n\nSee more: https://www.typescriptlang.org/tsconfig#esModuleInterop" + }, + "allowUmdGlobalAccess": { + "description": "Allow accessing UMD globals from modules.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Allow accessing UMD globals from modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUmdGlobalAccess" + }, + "keyofStringsOnly": { + "description": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.\n\nSee more: https://www.typescriptlang.org/tsconfig#keyofStringsOnly" + }, + "useDefineForClassFields": { + "description": "Emit ECMAScript-standard-compliant class fields.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Emit ECMAScript-standard-compliant class fields.\n\nSee more: https://www.typescriptlang.org/tsconfig#useDefineForClassFields" + }, + "declarationMap": { + "description": "Create sourcemaps for d.ts files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Create sourcemaps for d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationMap" + }, + "resolveJsonModule": { + "description": "Enable importing .json files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Enable importing .json files.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolveJsonModule" + }, + "resolvePackageJsonExports": { + "description": "Use the package.json 'exports' field when resolving package imports.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Use the package.json 'exports' field when resolving package imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonExports" + }, + "resolvePackageJsonImports": { + "description": "Use the package.json 'imports' field when resolving imports.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Use the package.json 'imports' field when resolving imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonImports" + }, + "assumeChangesOnlyAffectDirectDependencies": { + "description": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.", + "type": ["boolean", "null"], + "markdownDescription": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.\n\nSee more: https://www.typescriptlang.org/tsconfig#assumeChangesOnlyAffectDirectDependencies" + }, + "extendedDiagnostics": { + "description": "Output more detailed compiler performance information after building.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Output more detailed compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#extendedDiagnostics" + }, + "listFilesOnly": { + "description": "Print names of files that are part of the compilation and then stop processing.", + "type": ["boolean", "null"] + }, + "disableSourceOfProjectReferenceRedirect": { + "description": "Disable preferring source files instead of declaration files when referencing composite projects.", + "type": ["boolean", "null"], + "markdownDescription": "Disable preferring source files instead of declaration files when referencing composite projects.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSourceOfProjectReferenceRedirect" + }, + "disableSolutionSearching": { + "description": "Opt a project out of multi-project reference checking when editing.", + "type": ["boolean", "null"], + "markdownDescription": "Opt a project out of multi-project reference checking when editing.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSolutionSearching" + }, + "verbatimModuleSyntax": { + "description": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the `module` setting.", + "type": ["boolean", "null"], + "markdownDescription": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the `module` setting.\n\nSee more: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax" + }, + "noCheck": { + "description": "Disable full type checking (only critical parse and emit errors will be reported).", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Disable full type checking (only critical parse and emit errors will be reported).\n\nSee more: https://www.typescriptlang.org/tsconfig#noCheck" + }, + "isolatedDeclarations": { + "description": "Require sufficient annotation on exports so other tools can trivially generate declaration files.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Require sufficient annotation on exports so other tools can trivially generate declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedDeclarations" + }, + "noUncheckedSideEffectImports": { + "description": "Check side effect imports.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Check side effect imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedSideEffectImports" + }, + "strictBuiltinIteratorReturn": { + "description": "Built-in iterators are instantiated with a `TReturn` type of `undefined` instead of `any`.", + "type": ["boolean", "null"], + "default": false, + "markdownDescription": "Built-in iterators are instantiated with a `TReturn` type of `undefined` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBuiltinIteratorReturn" + } + } + } + } + }, + "typeAcquisitionDefinition": { + "properties": { + "typeAcquisition": { + "type": ["object", "null"], + "description": "Auto type (.d.ts) acquisition options for this project. Requires TypeScript version 2.1 or later.", + "properties": { + "enable": { + "description": "Enable auto type acquisition", + "type": ["boolean", "null"], + "default": false + }, + "include": { + "description": "Specifies a list of type declarations to be included in auto type acquisition. Ex. [\"jquery\", \"lodash\"]", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "exclude": { + "description": "Specifies a list of type declarations to be excluded from auto type acquisition. Ex. [\"jquery\", \"lodash\"]", + "type": ["array", "null"], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + } + } + }, + "referencesDefinition": { + "properties": { + "references": { + "type": "array", + "uniqueItems": true, + "description": "Referenced projects. Requires TypeScript version 3.0 or later.", + "items": { + "type": "object", + "description": "Project reference.", + "properties": { + "path": { + "type": "string", + "description": "Path to referenced tsconfig or to folder containing tsconfig." + } + } + } + } + } + }, + "tsNodeModuleTypes": { + "type": ["object", "null"] + }, + "tsNodeDefinition": { + "properties": { + "ts-node": { + "description": "ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n\nts-node offers TypeScript execution and REPL for node.js, with source map support.", + "properties": { + "compiler": { + "default": "typescript", + "description": "Specify a custom TypeScript compiler.", + "type": ["string", "null"] + }, + "compilerHost": { + "default": false, + "description": "Use TypeScript's compiler host API instead of the language service API.", + "type": ["boolean", "null"] + }, + "compilerOptions": { + "additionalProperties": true, + "allOf": [ + { + "$ref": "#/definitions/compilerOptionsDefinition/properties/compilerOptions" + } + ], + "description": "JSON object to merge with TypeScript `compilerOptions`.", + "properties": {}, + "type": ["object", "null"] + }, + "emit": { + "default": false, + "description": "Emit output files into `.ts-node` directory.", + "type": ["boolean", "null"] + }, + "esm": { + "description": "Enable native ESM support.\n\nFor details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules", + "type": ["boolean", "null"] + }, + "experimentalReplAwait": { + "description": "Allows the usage of top level await in REPL.\n\nUses node's implementation which accomplishes this with an AST syntax transformation.\n\nEnabled by default when tsconfig target is es2018 or above. Set to false to disable.\n\n**Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\nto get default, automatic behavior.", + "type": ["boolean", "null"] + }, + "experimentalResolver": { + "description": "Enable experimental features that re-map imports and require calls to support:\n`baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n`outDir` to `rootDir` mappings for composite projects and monorepos.\n\nFor details, see https://github.com/TypeStrong/ts-node/issues/1514", + "type": ["boolean", "null"] + }, + "experimentalSpecifierResolution": { + "description": "Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n\nFor details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm", + "enum": ["explicit", "node"], + "type": ["string", "null"] + }, + "files": { + "default": false, + "description": "Load \"files\" and \"include\" from `tsconfig.json` on startup.\n\nDefault is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.", + "type": ["boolean", "null"] + }, + "ignore": { + "default": ["(?:^|/)node_modules/"], + "description": "Paths which should not be compiled.\n\nEach string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n\nSource paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n\nDefault is to ignore all node_modules subdirectories.", + "items": { + "type": "string" + }, + "type": ["array", "null"] + }, + "ignoreDiagnostics": { + "description": "Ignore TypeScript warnings by diagnostic code.", + "items": { + "type": ["string", "number"] + }, + "type": ["array", "null"] + }, + "logError": { + "default": false, + "description": "Logs TypeScript errors to stderr instead of throwing exceptions.", + "type": ["boolean", "null"] + }, + "moduleTypes": { + "$ref": "#/definitions/tsNodeModuleTypes", + "description": "Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\nWhen overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\nthe file extension is ignored.\nThis is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\nit achieves the same effect.\n\nEach key is a glob pattern following the same rules as tsconfig's \"include\" array.\nWhen multiple patterns match the same file, the last pattern takes precedence.\n\n`cjs` overrides matches files to compile and execute as CommonJS.\n`esm` overrides matches files to compile and execute as native ECMAScript modules.\n`package` overrides either of the above to default behavior, which obeys package.json \"type\" and\ntsconfig.json \"module\" options." + }, + "preferTsExts": { + "default": false, + "description": "Re-order file extensions so that TypeScript imports are preferred.\n\nFor example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`", + "type": ["boolean", "null"] + }, + "pretty": { + "default": false, + "description": "Use pretty diagnostic formatter.", + "type": ["boolean", "null"] + }, + "require": { + "description": "Modules to require, like node's `--require` flag.\n\nIf specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n\nIf specified programmatically, each input string should be pre-resolved to an absolute path for\nbest results.", + "items": { + "type": "string" + }, + "type": ["array", "null"] + }, + "scope": { + "default": false, + "description": "Scope compiler to files within `scopeDir`.", + "type": ["boolean", "null"] + }, + "scopeDir": { + "default": "First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.", + "type": ["string", "null"] + }, + "skipIgnore": { + "default": false, + "description": "Skip ignore check, so that compilation will be attempted for all files with matching extensions.", + "type": ["boolean", "null"] + }, + "swc": { + "description": "Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n\nEquivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n\nFor complete instructions: https://typestrong.org/ts-node/docs/transpilers", + "type": ["boolean", "null"] + }, + "transpileOnly": { + "default": false, + "description": "Use TypeScript's faster `transpileModule`.", + "type": ["boolean", "null"] + }, + "transpiler": { + "anyOf": [ + { + "items": [ + { + "type": ["string", "null"] + }, + { + "additionalProperties": true, + "properties": {}, + "type": ["object", "null"] + } + ], + "maxItems": 2, + "minItems": 2, + "type": ["array", "null"] + }, + { + "type": ["string", "null"] + } + ], + "description": "Specify a custom transpiler for use with transpileOnly" + }, + "typeCheck": { + "default": true, + "description": "**DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).", + "type": ["boolean", "null"] + } + }, + "type": ["object", "null"] + } + } + } + }, + "id": "https://json.schemastore.org/tsconfig", + "title": "JSON schema for the TypeScript compiler's configuration file", + "type": "object" +} diff --git a/packages/language-service/src/cli/setup/changes.ts b/packages/language-service/src/cli/setup/changes.ts index f2e3112a..9c21b3bf 100644 --- a/packages/language-service/src/cli/setup/changes.ts +++ b/packages/language-service/src/cli/setup/changes.ts @@ -13,6 +13,8 @@ interface ComputeFileChangesResult { readonly messages: ReadonlyArray } +const TSCONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json" + /** * Create an empty ComputeFileChangesResult */ @@ -536,11 +538,22 @@ const computeTsConfigChanges = ( const fileChanges = textChanges.ChangeTracker.with( { host, formatContext, preferences }, (tracker: any) => { + const schemaProperty = findPropertyInObject(ts, rootObj, "$schema") const pluginsProperty = findPropertyInObject(ts, compilerOptions, "plugins") + const schemaPropertyAssignment = ts.factory.createPropertyAssignment( + ts.factory.createStringLiteral("$schema"), + ts.factory.createStringLiteral(TSCONFIG_SCHEMA_URL) + ) + // Check if we should remove the plugin (user doesn't want LSP installed) if (Option.isNone(lspVersion)) { // User wants to remove LSP + if (schemaProperty) { + descriptions.push("Remove $schema from tsconfig") + deleteNodeFromList(tracker, current.sourceFile, rootObj.properties, schemaProperty) + } + if (pluginsProperty && ts.isArrayLiteralExpression(pluginsProperty.initializer)) { const pluginsArray = pluginsProperty.initializer @@ -562,6 +575,16 @@ const computeTsConfigChanges = ( } } else { // User wants to add/keep LSP + if (!schemaProperty) { + descriptions.push("Add $schema to tsconfig") + insertNodeAtEndOfList(tracker, current.sourceFile, rootObj.properties, schemaPropertyAssignment) + } else if ( + !ts.isStringLiteral(schemaProperty.initializer) || schemaProperty.initializer.text !== TSCONFIG_SCHEMA_URL + ) { + descriptions.push("Update $schema in tsconfig") + tracker.replaceNode(current.sourceFile, schemaProperty.initializer, schemaPropertyAssignment.initializer) + } + const buildPluginObject = (severities: Option.Option>) => { const nameProperty = ts.factory.createPropertyAssignment( ts.factory.createStringLiteral("name"), diff --git a/packages/language-service/src/core/LanguageServicePluginOptions.ts b/packages/language-service/src/core/LanguageServicePluginOptions.ts index 4287bcf5..9449ef1d 100644 --- a/packages/language-service/src/core/LanguageServicePluginOptions.ts +++ b/packages/language-service/src/core/LanguageServicePluginOptions.ts @@ -47,6 +47,23 @@ export interface LanguageServicePluginOptions { skipDisabledOptimization: boolean } +export interface JsonSchema { + $ref?: string + description?: string + markdownDescription?: string + type?: string | Array + default?: unknown + enum?: ReadonlyArray + required?: Array + uniqueItems?: boolean + items?: JsonSchema + properties?: Record + additionalProperties?: boolean | JsonSchema + anyOf?: ReadonlyArray + oneOf?: ReadonlyArray + not?: JsonSchema +} + export const LanguageServicePluginOptions = Nano.Tag("PluginOptions") function isValidSeverityLevel(value: string): value is DiagnosticSeverity | "off" { @@ -105,6 +122,155 @@ export const defaults: LanguageServicePluginOptions = { skipDisabledOptimization: false } +const booleanSchema = (description: string, defaultValue: boolean): JsonSchema => ({ + type: "boolean", + description, + default: defaultValue +}) + +const stringArraySchema = (description: string, defaultValue: Array): JsonSchema => ({ + type: "array", + description, + default: defaultValue, + items: { type: "string" } +}) + +const stringEnumSchema = >( + description: string, + values: A, + defaultValue: A[number] +): JsonSchema => ({ + type: "string", + description, + enum: values, + default: defaultValue +}) + +type LanguageServicePluginAdditionalProperty = Exclude + +export const languageServicePluginAdditionalPropertiesJsonSchema = { + refactors: booleanSchema("Controls Effect refactors.", defaults.refactors), + diagnostics: booleanSchema("Controls Effect diagnostics.", defaults.diagnostics), + diagnosticsName: booleanSchema( + "Controls whether to include the rule name in diagnostic messages.", + defaults.diagnosticsName + ), + missingDiagnosticNextLine: stringEnumSchema( + "Controls the severity of warnings for unused @effect-diagnostics-next-line comments.", + ["off", "error", "warning", "message", "suggestion"], + defaults.missingDiagnosticNextLine + ), + includeSuggestionsInTsc: booleanSchema( + "When patch mode is enabled, reports suggestion diagnostics as messages in TSC with a [suggestion] prefix.", + defaults.includeSuggestionsInTsc + ), + ignoreEffectWarningsInTscExitCode: booleanSchema( + "When enabled, Effect warnings do not affect the patched tsc exit code.", + defaults.ignoreEffectWarningsInTscExitCode + ), + ignoreEffectErrorsInTscExitCode: booleanSchema( + "When enabled, Effect errors do not affect the patched tsc exit code.", + defaults.ignoreEffectErrorsInTscExitCode + ), + ignoreEffectSuggestionsInTscExitCode: booleanSchema( + "When enabled, Effect suggestions do not affect the patched tsc exit code.", + defaults.ignoreEffectSuggestionsInTscExitCode + ), + quickinfoEffectParameters: stringEnumSchema( + "Controls when Effect quickinfo should include full type parameters.", + ["always", "never", "whentruncated"], + defaults.quickinfoEffectParameters + ), + quickinfo: booleanSchema("Controls Effect quickinfo.", defaults.quickinfo), + quickinfoMaximumLength: { + type: "number", + description: "Controls the maximum quickinfo length. Use -1 to disable truncation.", + default: defaults.quickinfoMaximumLength + }, + keyPatterns: { + type: "array", + description: "Configures key patterns used for generated Effect service and error keys.", + default: defaults.keyPatterns, + items: { + type: "object", + properties: { + target: stringEnumSchema("The key builder target.", ["service", "error", "custom"], "service"), + pattern: stringEnumSchema( + "The key generation pattern.", + ["package-identifier", "default", "default-hashed"], + "default" + ), + skipLeadingPath: stringArraySchema("Path prefixes to strip before generating keys.", ["src/"]) + } + } + }, + extendedKeyDetection: booleanSchema( + "Enables extended heuristics when detecting key sources.", + defaults.extendedKeyDetection + ), + completions: booleanSchema("Controls Effect completions.", defaults.completions), + goto: booleanSchema("Controls Effect goto references support.", defaults.goto), + inlays: booleanSchema("Controls Effect inlay hints.", defaults.inlays), + allowedDuplicatedPackages: stringArraySchema( + "Package names that are allowed to duplicate Effect as a peer dependency.", + defaults.allowedDuplicatedPackages + ), + namespaceImportPackages: stringArraySchema( + "Package names that should prefer namespace imports.", + defaults.namespaceImportPackages + ), + topLevelNamedReexports: stringEnumSchema( + "For namespaceImportPackages, controls how top-level named re-exports are handled.", + ["ignore", "follow"], + defaults.topLevelNamedReexports + ), + barrelImportPackages: stringArraySchema( + "Package names that should prefer imports from their top-level barrel file.", + defaults.barrelImportPackages + ), + importAliases: { + type: "object", + description: "Custom aliases to use for imported identifiers.", + default: defaults.importAliases, + additionalProperties: { + type: "string" + } + }, + renames: booleanSchema("Controls Effect rename helpers.", defaults.renames), + noExternal: booleanSchema( + "Disables features that link to external websites.", + defaults.noExternal + ), + pipeableMinArgCount: { + type: "number", + description: "Minimum argument count required before pipeable suggestions are emitted.", + default: defaults.pipeableMinArgCount + }, + effectFn: { + type: "array", + description: "Configures which Effect.fn variants should be suggested.", + default: defaults.effectFn, + items: { + type: "string", + enum: ["untraced", "span", "suggested-span", "inferred-span", "no-span"] + } + }, + layerGraphFollowDepth: { + type: "number", + description: "Controls how deeply layer graph analysis follows dependencies.", + default: defaults.layerGraphFollowDepth + }, + mermaidProvider: { + type: "string", + description: "Controls which Mermaid renderer is used for layer graphs.", + default: defaults.mermaidProvider + }, + skipDisabledOptimization: booleanSchema( + "When enabled, disabled diagnostics are still processed so comment-based overrides can be honored.", + defaults.skipDisabledOptimization + ) +} satisfies Record + function parseKeyPatterns(patterns: Array): Array { const result: Array = [] for (const entry of patterns) { diff --git a/packages/language-service/test/setup-cli.test.ts b/packages/language-service/test/setup-cli.test.ts index e1053b97..452ac2d4 100644 --- a/packages/language-service/test/setup-cli.test.ts +++ b/packages/language-service/test/setup-cli.test.ts @@ -203,6 +203,7 @@ describe("Setup CLI", () => { } }, { + $schema: "https://raw.githubusercontent.com/Effect-TS/language-service/refs/heads/main/schema.json", compilerOptions: { strict: true, target: "ES2022", @@ -230,6 +231,37 @@ describe("Setup CLI", () => { await expectSetupChanges(assessmentInput, targetState) }) + it("should replace existing tsconfig schema when adding LSP", async () => { + const assessmentInput = createTestAssessmentInput( + { + name: "test-project", + version: "1.0.0", + dependencies: {} + }, + { + $schema: "https://json.schemastore.org/tsconfig", + compilerOptions: { + strict: true, + target: "ES2022" + } + } + ) + + const targetState: Target.State = { + packageJson: { + lspVersion: Option.some({ dependencyType: "devDependencies" as const, version: "workspace:*" }), + prepareScript: false + }, + tsconfig: { + diagnosticSeverities: Option.none() + }, + vscodeSettings: Option.none(), + editors: [] + } + + await expectSetupChanges(assessmentInput, targetState) + }) + it("should generate changes for adding LSP with custom diagnostic severities", async () => { const assessmentInput = createTestAssessmentInput( { diff --git a/schema.json b/schema.json new file mode 100644 index 00000000..57bd05a9 --- /dev/null +++ b/schema.json @@ -0,0 +1,2804 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$comment": "Note that this schema uses 'null' in various places. The value of 'null' is UNDOCUMENTED (https://github.com/microsoft/TypeScript/pull/18058)", + "allowTrailingCommas": true, + "allOf": [ + { + "$ref": "#/definitions/compilerOptionsDefinition" + }, + { + "$ref": "#/definitions/compileOnSaveDefinition" + }, + { + "$ref": "#/definitions/typeAcquisitionDefinition" + }, + { + "$ref": "#/definitions/extendsDefinition" + }, + { + "$ref": "#/definitions/watchOptionsDefinition" + }, + { + "$ref": "#/definitions/buildOptionsDefinition" + }, + { + "$ref": "#/definitions/tsNodeDefinition" + }, + { + "anyOf": [ + { + "$ref": "#/definitions/filesDefinition" + }, + { + "$ref": "#/definitions/excludeDefinition" + }, + { + "$ref": "#/definitions/includeDefinition" + }, + { + "$ref": "#/definitions/referencesDefinition" + } + ] + } + ], + "definitions": { + "//": { + "explainer": "https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#overview", + "reference": "https://www.typescriptlang.org/tsconfig", + "reference metadata": "https://github.com/microsoft/TypeScript-Website/blob/v2/packages/tsconfig-reference/scripts/tsconfigRules.ts" + }, + "filesDefinition": { + "properties": { + "files": { + "description": "If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + }, + "excludeDefinition": { + "properties": { + "exclude": { + "description": "Specifies a list of files to be excluded from compilation. The 'exclude' property only affects the files included via the 'include' property and not the 'files' property. Glob patterns require TypeScript version 2.0 or later.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + }, + "includeDefinition": { + "properties": { + "include": { + "description": "Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + }, + "compileOnSaveDefinition": { + "properties": { + "compileOnSave": { + "description": "Enable Compile-on-Save for this project.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "extendsDefinition": { + "properties": { + "extends": { + "description": "Path to base configuration file to inherit from (requires TypeScript version 2.1 or later), or array of base files, with the rightmost files having the greater priority (requires TypeScript version 5.0 or later).", + "oneOf": [ + { + "default": "", + "type": "string" + }, + { + "default": [], + "items": { + "type": "string" + }, + "type": "array" + } + ] + } + } + }, + "buildOptionsDefinition": { + "properties": { + "buildOptions": { + "properties": { + "dry": { + "description": "~", + "type": [ + "boolean", + "null" + ], + "default": false + }, + "force": { + "description": "Build all projects, including those that appear to be up to date", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Build all projects, including those that appear to be up to date\n\nSee more: https://www.typescriptlang.org/tsconfig#force" + }, + "verbose": { + "description": "Enable verbose logging", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable verbose logging\n\nSee more: https://www.typescriptlang.org/tsconfig#verbose" + }, + "incremental": { + "description": "Save .tsbuildinfo files to allow for incremental compilation of projects.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Save .tsbuildinfo files to allow for incremental compilation of projects.\n\nSee more: https://www.typescriptlang.org/tsconfig#incremental" + }, + "assumeChangesOnlyAffectDirectDependencies": { + "description": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.\n\nSee more: https://www.typescriptlang.org/tsconfig#assumeChangesOnlyAffectDirectDependencies" + }, + "traceResolution": { + "description": "Log paths used during the `moduleResolution` process.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Log paths used during the `moduleResolution` process.\n\nSee more: https://www.typescriptlang.org/tsconfig#traceResolution" + } + } + } + } + }, + "watchOptionsDefinition": { + "properties": { + "watchOptions": { + "type": [ + "object", + "null" + ], + "description": "Settings for the watch mode in TypeScript.", + "properties": { + "force": { + "description": "~", + "type": [ + "string", + "null" + ] + }, + "watchFile": { + "description": "Specify how the TypeScript watch mode works.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify how the TypeScript watch mode works.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchFile" + }, + "watchDirectory": { + "description": "Specify how directories are watched on systems that lack recursive file-watching functionality.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify how directories are watched on systems that lack recursive file-watching functionality.\n\nSee more: https://www.typescriptlang.org/tsconfig#watchDirectory" + }, + "fallbackPolling": { + "description": "Specify what approach the watcher should use if the system runs out of native file watchers.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify what approach the watcher should use if the system runs out of native file watchers.\n\nSee more: https://www.typescriptlang.org/tsconfig#fallbackPolling" + }, + "synchronousWatchDirectory": { + "description": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.\n\nSee more: https://www.typescriptlang.org/tsconfig#synchronousWatchDirectory" + }, + "excludeFiles": { + "description": "Remove a list of files from the watch mode's processing.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Remove a list of files from the watch mode's processing.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeFiles" + }, + "excludeDirectories": { + "description": "Remove a list of directories from the watch process.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Remove a list of directories from the watch process.\n\nSee more: https://www.typescriptlang.org/tsconfig#excludeDirectories" + } + } + } + } + }, + "compilerOptionsDefinition": { + "properties": { + "compilerOptions": { + "type": [ + "object", + "null" + ], + "description": "Instructs the TypeScript compiler how to compile .ts files.", + "properties": { + "allowArbitraryExtensions": { + "description": "Enable importing files with any extension, provided a declaration file is present.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Enable importing files with any extension, provided a declaration file is present.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowArbitraryExtensions" + }, + "allowImportingTsExtensions": { + "description": "Allow imports to include TypeScript file extensions. Requires `--moduleResolution bundler` and either `--noEmit` or `--emitDeclarationOnly` to be set.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Allow imports to include TypeScript file extensions. Requires `--moduleResolution bundler` and either `--noEmit` or `--emitDeclarationOnly` to be set.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions" + }, + "charset": { + "description": "No longer supported. In early versions, manually set the text encoding for reading files.", + "type": [ + "string", + "null" + ], + "markdownDescription": "No longer supported. In early versions, manually set the text encoding for reading files.\n\nSee more: https://www.typescriptlang.org/tsconfig#charset" + }, + "composite": { + "description": "Enable constraints that allow a TypeScript project to be used with project references.", + "type": [ + "boolean", + "null" + ], + "default": true, + "markdownDescription": "Enable constraints that allow a TypeScript project to be used with project references.\n\nSee more: https://www.typescriptlang.org/tsconfig#composite" + }, + "customConditions": { + "description": "Conditions to set in addition to the resolver-specific defaults when resolving imports.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Conditions to set in addition to the resolver-specific defaults when resolving imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#customConditions" + }, + "declaration": { + "description": "Generate .d.ts files from TypeScript and JavaScript files in your project.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Generate .d.ts files from TypeScript and JavaScript files in your project.\n\nSee more: https://www.typescriptlang.org/tsconfig#declaration" + }, + "declarationDir": { + "description": "Specify the output directory for generated declaration files.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify the output directory for generated declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationDir" + }, + "diagnostics": { + "description": "Output compiler performance information after building.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Output compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#diagnostics" + }, + "disableReferencedProjectLoad": { + "description": "Reduce the number of projects loaded automatically by TypeScript.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Reduce the number of projects loaded automatically by TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableReferencedProjectLoad" + }, + "noPropertyAccessFromIndexSignature": { + "description": "Enforces using indexed accessors for keys declared using an indexed type.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type.\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature" + }, + "emitBOM": { + "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitBOM" + }, + "emitDeclarationOnly": { + "description": "Only output d.ts files and not JavaScript files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Only output d.ts files and not JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly" + }, + "erasableSyntaxOnly": { + "description": "Do not allow runtime constructs that are not part of ECMAScript.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Do not allow runtime constructs that are not part of ECMAScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#erasableSyntaxOnly" + }, + "exactOptionalPropertyTypes": { + "description": "Interpret optional property types as written, rather than adding `undefined`.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Interpret optional property types as written, rather than adding `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes" + }, + "incremental": { + "description": "Enable incremental compilation. Requires TypeScript version 3.4 or later.", + "type": [ + "boolean", + "null" + ] + }, + "tsBuildInfoFile": { + "description": "Specify the path to .tsbuildinfo incremental compilation file.", + "default": ".tsbuildinfo", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify the path to .tsbuildinfo incremental compilation file.\n\nSee more: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile" + }, + "inlineSourceMap": { + "description": "Include sourcemap files inside the emitted JavaScript.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Include sourcemap files inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSourceMap" + }, + "inlineSources": { + "description": "Include source code in the sourcemaps inside the emitted JavaScript.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Include source code in the sourcemaps inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSources" + }, + "jsx": { + "description": "Specify what JSX code is generated.", + "enum": [ + "preserve", + "react", + "react-jsx", + "react-jsxdev", + "react-native" + ], + "markdownDescription": "Specify what JSX code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsx" + }, + "reactNamespace": { + "description": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.", + "type": [ + "string", + "null" + ], + "default": "React", + "markdownDescription": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.\n\nSee more: https://www.typescriptlang.org/tsconfig#reactNamespace" + }, + "jsxFactory": { + "description": "Specify the JSX factory function used when targeting React JSX emit, e.g. `React.createElement` or `h`.", + "type": [ + "string", + "null" + ], + "default": "React.createElement", + "markdownDescription": "Specify the JSX factory function used when targeting React JSX emit, e.g. `React.createElement` or `h`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFactory" + }, + "jsxFragmentFactory": { + "description": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. `React.Fragment` or `Fragment`.", + "type": [ + "string", + "null" + ], + "default": "React.Fragment", + "markdownDescription": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. `React.Fragment` or `Fragment`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFragmentFactory" + }, + "jsxImportSource": { + "description": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.", + "type": [ + "string", + "null" + ], + "default": "react", + "markdownDescription": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxImportSource" + }, + "listFiles": { + "description": "Print all of the files read during the compilation.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Print all of the files read during the compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listFiles" + }, + "mapRoot": { + "description": "Specify the location where debugger should locate map files instead of generated locations.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify the location where debugger should locate map files instead of generated locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#mapRoot" + }, + "module": { + "description": "Specify what module code is generated.", + "type": [ + "string", + "null" + ], + "anyOf": [ + { + "enum": [ + "commonjs", + "amd", + "system", + "umd", + "es6", + "es2015", + "es2020", + "esnext", + "none", + "es2022", + "node16", + "node18", + "node20", + "nodenext", + "preserve" + ] + }, + { + "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|20(1[567]|2[02])|[Nn][Ee][Xx][Tt])|[Nn][Oo][dD][Ee](1[68]|20)|[Nn][Oo][Dd][Ee][Nn][Ee][Xx][Tt]|[Nn][Oo][Nn][Ee]|[Pp][Rr][Ee][Ss][Ee][Rr][Vv][Ee])$" + } + ], + "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module" + }, + "moduleResolution": { + "description": "Specify how TypeScript looks up a file from a given module specifier.", + "type": [ + "string", + "null" + ], + "anyOf": [ + { + "enum": [ + "classic", + "node", + "node10", + "node16", + "nodenext", + "bundler" + ], + "markdownEnumDescriptions": [ + "It’s recommended to use `\"node16\"` instead", + "Deprecated, use `\"node10\"` in TypeScript 5.0+ instead", + "It’s recommended to use `\"node16\"` instead", + "This is the recommended setting for libraries and Node.js applications", + "This is the recommended setting for libraries and Node.js applications", + "This is the recommended setting in TypeScript 5.0+ for applications that use a bundler" + ] + }, + { + "pattern": "^(([Nn]ode)|([Nn]ode1[06])|([Nn]ode[Nn]ext)|([Cc]lassic)|([Bb]undler))$" + } + ], + "markdownDescription": "Specify how TypeScript looks up a file from a given module specifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleResolution" + }, + "moduleSuffixes": { + "description": "List of file name suffixes to search when resolving a module.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "List of file name suffixes to search when resolving a module.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleSuffixes" + }, + "newLine": { + "description": "Set the newline character for emitting files.", + "type": [ + "string", + "null" + ], + "default": "lf", + "anyOf": [ + { + "enum": [ + "crlf", + "lf" + ] + }, + { + "pattern": "^(CRLF|LF|crlf|lf)$" + } + ], + "markdownDescription": "Set the newline character for emitting files.\n\nSee more: https://www.typescriptlang.org/tsconfig#newLine" + }, + "noEmit": { + "description": "Disable emitting files from a compilation.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable emitting files from a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmit" + }, + "noEmitHelpers": { + "description": "Disable generating custom helper functions like `__extends` in compiled output.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable generating custom helper functions like `__extends` in compiled output.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitHelpers" + }, + "noEmitOnError": { + "description": "Disable emitting files if any type checking errors are reported.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable emitting files if any type checking errors are reported.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitOnError" + }, + "noImplicitAny": { + "description": "Enable error reporting for expressions and declarations with an implied `any` type.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Enable error reporting for expressions and declarations with an implied `any` type.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitAny" + }, + "noImplicitThis": { + "description": "Enable error reporting when `this` is given the type `any`.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Enable error reporting when `this` is given the type `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitThis" + }, + "noUnusedLocals": { + "description": "Enable error reporting when local variables aren't read.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable error reporting when local variables aren't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedLocals" + }, + "noUnusedParameters": { + "description": "Raise an error when a function parameter isn't read.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Raise an error when a function parameter isn't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedParameters" + }, + "noLib": { + "description": "Disable including any library files, including the default lib.d.ts.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable including any library files, including the default lib.d.ts.\n\nSee more: https://www.typescriptlang.org/tsconfig#noLib" + }, + "noResolve": { + "description": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project.\n\nSee more: https://www.typescriptlang.org/tsconfig#noResolve" + }, + "noStrictGenericChecks": { + "description": "Disable strict checking of generic signatures in function types.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable strict checking of generic signatures in function types.\n\nSee more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks" + }, + "out": { + "description": "Deprecated setting. Use `outFile` instead.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Deprecated setting. Use `outFile` instead.\n\nSee more: https://www.typescriptlang.org/tsconfig#out" + }, + "skipDefaultLibCheck": { + "description": "Skip type checking .d.ts files that are included with TypeScript.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Skip type checking .d.ts files that are included with TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipDefaultLibCheck" + }, + "skipLibCheck": { + "description": "Skip type checking all .d.ts files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Skip type checking all .d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipLibCheck" + }, + "outFile": { + "description": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.\n\nSee more: https://www.typescriptlang.org/tsconfig#outFile" + }, + "outDir": { + "description": "Specify an output folder for all emitted files.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify an output folder for all emitted files.\n\nSee more: https://www.typescriptlang.org/tsconfig#outDir" + }, + "preserveConstEnums": { + "description": "Disable erasing `const enum` declarations in generated code.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable erasing `const enum` declarations in generated code.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveConstEnums" + }, + "preserveSymlinks": { + "description": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveSymlinks" + }, + "preserveValueImports": { + "description": "Preserve unused imported values in the JavaScript output that would otherwise be removed.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Preserve unused imported values in the JavaScript output that would otherwise be removed.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveValueImports" + }, + "preserveWatchOutput": { + "description": "Disable wiping the console in watch mode.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Disable wiping the console in watch mode.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveWatchOutput" + }, + "pretty": { + "description": "Enable color and formatting in TypeScript's output to make compiler errors easier to read.", + "type": [ + "boolean", + "null" + ], + "default": true, + "markdownDescription": "Enable color and formatting in TypeScript's output to make compiler errors easier to read.\n\nSee more: https://www.typescriptlang.org/tsconfig#pretty" + }, + "removeComments": { + "description": "Disable emitting comments.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments" + }, + "rewriteRelativeImportExtensions": { + "description": "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions" + }, + "rootDir": { + "description": "Specify the root folder within your source files.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify the root folder within your source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDir" + }, + "isolatedModules": { + "description": "Ensure that each file can be safely transpiled without relying on other imports.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Ensure that each file can be safely transpiled without relying on other imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedModules" + }, + "sourceMap": { + "description": "Create source map files for emitted JavaScript files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Create source map files for emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceMap" + }, + "sourceRoot": { + "description": "Specify the root path for debuggers to find the reference source code.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify the root path for debuggers to find the reference source code.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceRoot" + }, + "suppressExcessPropertyErrors": { + "description": "Disable reporting of excess property errors during the creation of object literals.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable reporting of excess property errors during the creation of object literals.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors" + }, + "suppressImplicitAnyIndexErrors": { + "description": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors" + }, + "stripInternal": { + "description": "Disable emitting declarations that have `@internal` in their JSDoc comments.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Disable emitting declarations that have `@internal` in their JSDoc comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#stripInternal" + }, + "target": { + "description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.", + "type": [ + "string", + "null" + ], + "default": "es3", + "anyOf": [ + { + "enum": [ + "es3", + "es5", + "es6", + "es2015", + "es2016", + "es2017", + "es2018", + "es2019", + "es2020", + "es2021", + "es2022", + "es2023", + "es2024", + "esnext" + ] + }, + { + "pattern": "^([Ee][Ss]([356]|(20(1[56789]|2[01234]))|[Nn][Ee][Xx][Tt]))$" + } + ], + "markdownDescription": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.\n\nSee more: https://www.typescriptlang.org/tsconfig#target" + }, + "useUnknownInCatchVariables": { + "description": "Default catch clause variables as `unknown` instead of `any`.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Default catch clause variables as `unknown` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables" + }, + "watch": { + "description": "Watch input files.", + "type": [ + "boolean", + "null" + ] + }, + "fallbackPolling": { + "description": "Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. Requires TypeScript version 3.8 or later.", + "enum": [ + "fixedPollingInterval", + "priorityPollingInterval", + "dynamicPriorityPolling", + "fixedInterval", + "priorityInterval", + "dynamicPriority", + "fixedChunkSize" + ] + }, + "watchDirectory": { + "description": "Specify the strategy for watching directories under systems that lack recursive file-watching functionality. Requires TypeScript version 3.8 or later.", + "enum": [ + "useFsEvents", + "fixedPollingInterval", + "dynamicPriorityPolling", + "fixedChunkSizePolling" + ], + "default": "useFsEvents" + }, + "watchFile": { + "description": "Specify the strategy for watching individual files. Requires TypeScript version 3.8 or later.", + "enum": [ + "fixedPollingInterval", + "priorityPollingInterval", + "dynamicPriorityPolling", + "useFsEvents", + "useFsEventsOnParentDirectory", + "fixedChunkSizePolling" + ], + "default": "useFsEvents" + }, + "experimentalDecorators": { + "description": "Enable experimental support for legacy experimental decorators.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Enable experimental support for legacy experimental decorators.\n\nSee more: https://www.typescriptlang.org/tsconfig#experimentalDecorators" + }, + "emitDecoratorMetadata": { + "description": "Emit design-type metadata for decorated declarations in source files.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Emit design-type metadata for decorated declarations in source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata" + }, + "allowUnusedLabels": { + "description": "Disable error reporting for unused labels.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Disable error reporting for unused labels.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnusedLabels" + }, + "noImplicitReturns": { + "description": "Enable error reporting for codepaths that do not explicitly return in a function.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable error reporting for codepaths that do not explicitly return in a function.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitReturns" + }, + "noUncheckedIndexedAccess": { + "description": "Add `undefined` to a type when accessed using an index.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess" + }, + "noFallthroughCasesInSwitch": { + "description": "Enable error reporting for fallthrough cases in switch statements.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable error reporting for fallthrough cases in switch statements.\n\nSee more: https://www.typescriptlang.org/tsconfig#noFallthroughCasesInSwitch" + }, + "noImplicitOverride": { + "description": "Ensure overriding members in derived classes are marked with an override modifier.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Ensure overriding members in derived classes are marked with an override modifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitOverride" + }, + "allowUnreachableCode": { + "description": "Disable error reporting for unreachable code.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Disable error reporting for unreachable code.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnreachableCode" + }, + "forceConsistentCasingInFileNames": { + "description": "Ensure that casing is correct in imports.", + "type": [ + "boolean", + "null" + ], + "default": true, + "markdownDescription": "Ensure that casing is correct in imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames" + }, + "generateCpuProfile": { + "description": "Emit a v8 CPU profile of the compiler run for debugging.", + "type": [ + "string", + "null" + ], + "default": "profile.cpuprofile", + "markdownDescription": "Emit a v8 CPU profile of the compiler run for debugging.\n\nSee more: https://www.typescriptlang.org/tsconfig#generateCpuProfile" + }, + "baseUrl": { + "description": "Specify the base directory to resolve non-relative module names.", + "type": [ + "string", + "null" + ], + "markdownDescription": "Specify the base directory to resolve non-relative module names.\n\nSee more: https://www.typescriptlang.org/tsconfig#baseUrl" + }, + "paths": { + "description": "Specify a set of entries that re-map imports to additional lookup locations.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "description": "Path mapping to be computed relative to baseUrl option." + } + }, + "markdownDescription": "Specify a set of entries that re-map imports to additional lookup locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#paths" + }, + "plugins": { + "description": "Specify a list of language service plugins to include.", + "type": [ + "array", + "null" + ], + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "enum": [ + "@effect/language-service" + ], + "description": "Plugin name." + }, + "refactors": { + "type": "boolean", + "description": "Controls Effect refactors.", + "default": true + }, + "diagnostics": { + "type": "boolean", + "description": "Controls Effect diagnostics.", + "default": true + }, + "diagnosticsName": { + "type": "boolean", + "description": "Controls whether to include the rule name in diagnostic messages.", + "default": true + }, + "missingDiagnosticNextLine": { + "type": "string", + "description": "Controls the severity of warnings for unused @effect-diagnostics-next-line comments.", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning" + }, + "includeSuggestionsInTsc": { + "type": "boolean", + "description": "When patch mode is enabled, reports suggestion diagnostics as messages in TSC with a [suggestion] prefix.", + "default": true + }, + "ignoreEffectWarningsInTscExitCode": { + "type": "boolean", + "description": "When enabled, Effect warnings do not affect the patched tsc exit code.", + "default": false + }, + "ignoreEffectErrorsInTscExitCode": { + "type": "boolean", + "description": "When enabled, Effect errors do not affect the patched tsc exit code.", + "default": false + }, + "ignoreEffectSuggestionsInTscExitCode": { + "type": "boolean", + "description": "When enabled, Effect suggestions do not affect the patched tsc exit code.", + "default": true + }, + "quickinfoEffectParameters": { + "type": "string", + "description": "Controls when Effect quickinfo should include full type parameters.", + "enum": [ + "always", + "never", + "whentruncated" + ], + "default": "whentruncated" + }, + "quickinfo": { + "type": "boolean", + "description": "Controls Effect quickinfo.", + "default": true + }, + "quickinfoMaximumLength": { + "type": "number", + "description": "Controls the maximum quickinfo length. Use -1 to disable truncation.", + "default": -1 + }, + "keyPatterns": { + "type": "array", + "description": "Configures key patterns used for generated Effect service and error keys.", + "default": [ + { + "target": "service", + "pattern": "default", + "skipLeadingPath": [ + "src/" + ] + }, + { + "target": "custom", + "pattern": "default", + "skipLeadingPath": [ + "src/" + ] + } + ], + "items": { + "type": "object", + "properties": { + "target": { + "type": "string", + "description": "The key builder target.", + "enum": [ + "service", + "error", + "custom" + ], + "default": "service" + }, + "pattern": { + "type": "string", + "description": "The key generation pattern.", + "enum": [ + "package-identifier", + "default", + "default-hashed" + ], + "default": "default" + }, + "skipLeadingPath": { + "type": "array", + "description": "Path prefixes to strip before generating keys.", + "default": [ + "src/" + ], + "items": { + "type": "string" + } + } + } + } + }, + "extendedKeyDetection": { + "type": "boolean", + "description": "Enables extended heuristics when detecting key sources.", + "default": false + }, + "completions": { + "type": "boolean", + "description": "Controls Effect completions.", + "default": true + }, + "goto": { + "type": "boolean", + "description": "Controls Effect goto references support.", + "default": true + }, + "inlays": { + "type": "boolean", + "description": "Controls Effect inlay hints.", + "default": true + }, + "allowedDuplicatedPackages": { + "type": "array", + "description": "Package names that are allowed to duplicate Effect as a peer dependency.", + "default": [], + "items": { + "type": "string" + } + }, + "namespaceImportPackages": { + "type": "array", + "description": "Package names that should prefer namespace imports.", + "default": [], + "items": { + "type": "string" + } + }, + "topLevelNamedReexports": { + "type": "string", + "description": "For namespaceImportPackages, controls how top-level named re-exports are handled.", + "enum": [ + "ignore", + "follow" + ], + "default": "ignore" + }, + "barrelImportPackages": { + "type": "array", + "description": "Package names that should prefer imports from their top-level barrel file.", + "default": [], + "items": { + "type": "string" + } + }, + "importAliases": { + "type": "object", + "description": "Custom aliases to use for imported identifiers.", + "default": {}, + "additionalProperties": { + "type": "string" + } + }, + "renames": { + "type": "boolean", + "description": "Controls Effect rename helpers.", + "default": true + }, + "noExternal": { + "type": "boolean", + "description": "Disables features that link to external websites.", + "default": false + }, + "pipeableMinArgCount": { + "type": "number", + "description": "Minimum argument count required before pipeable suggestions are emitted.", + "default": 2 + }, + "effectFn": { + "type": "array", + "description": "Configures which Effect.fn variants should be suggested.", + "default": [ + "span" + ], + "items": { + "type": "string", + "enum": [ + "untraced", + "span", + "suggested-span", + "inferred-span", + "no-span" + ] + } + }, + "layerGraphFollowDepth": { + "type": "number", + "description": "Controls how deeply layer graph analysis follows dependencies.", + "default": 0 + }, + "mermaidProvider": { + "type": "string", + "description": "Controls which Mermaid renderer is used for layer graphs.", + "default": "mermaid.live" + }, + "skipDisabledOptimization": { + "type": "boolean", + "description": "When enabled, disabled diagnostics are still processed so comment-based overrides can be honored.", + "default": false + }, + "diagnosticSeverity": { + "$ref": "#/definitions/effectLanguageServicePluginDiagnosticSeverityDefinition" + } + }, + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "name": { + "description": "Plugin name.", + "type": "string", + "not": { + "enum": [ + "@effect/language-service" + ] + } + } + } + } + ] + }, + "markdownDescription": "Specify a list of language service plugins to include.\n\nSee more: https://www.typescriptlang.org/tsconfig#plugins" + }, + "rootDirs": { + "description": "Allow multiple folders to be treated as one when resolving modules.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Allow multiple folders to be treated as one when resolving modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDirs" + }, + "typeRoots": { + "description": "Specify multiple folders that act like `./node_modules/@types`.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Specify multiple folders that act like `./node_modules/@types`.\n\nSee more: https://www.typescriptlang.org/tsconfig#typeRoots" + }, + "types": { + "description": "Specify type package names to be included without being referenced in a source file.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + }, + "markdownDescription": "Specify type package names to be included without being referenced in a source file.\n\nSee more: https://www.typescriptlang.org/tsconfig#types" + }, + "traceResolution": { + "description": "Log paths used during the `moduleResolution` process.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Log paths used during the `moduleResolution` process.\n\nSee more: https://www.typescriptlang.org/tsconfig#traceResolution" + }, + "allowJs": { + "description": "Allow JavaScript files to be a part of your program. Use the `checkJs` option to get errors from these files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Allow JavaScript files to be a part of your program. Use the `checkJs` option to get errors from these files.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowJs" + }, + "noErrorTruncation": { + "description": "Disable truncating types in error messages.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable truncating types in error messages.\n\nSee more: https://www.typescriptlang.org/tsconfig#noErrorTruncation" + }, + "allowSyntheticDefaultImports": { + "description": "Allow `import x from y` when a module doesn't have a default export.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Allow `import x from y` when a module doesn't have a default export.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports" + }, + "noImplicitUseStrict": { + "description": "Disable adding `use strict` directives in emitted JavaScript files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable adding `use strict` directives in emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict" + }, + "listEmittedFiles": { + "description": "Print the names of emitted files after a compilation.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Print the names of emitted files after a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listEmittedFiles" + }, + "disableSizeLimit": { + "description": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSizeLimit" + }, + "lib": { + "description": "Specify a set of bundled library declaration files that describe the target runtime environment.", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string", + "anyOf": [ + { + "enum": [ + "ES5", + "ES6", + "ES2015", + "ES2015.Collection", + "ES2015.Core", + "ES2015.Generator", + "ES2015.Iterable", + "ES2015.Promise", + "ES2015.Proxy", + "ES2015.Reflect", + "ES2015.Symbol.WellKnown", + "ES2015.Symbol", + "ES2016", + "ES2016.Array.Include", + "ES2017", + "ES2017.Intl", + "ES2017.Object", + "ES2017.SharedMemory", + "ES2017.String", + "ES2017.TypedArrays", + "ES2017.ArrayBuffer", + "ES2018", + "ES2018.AsyncGenerator", + "ES2018.AsyncIterable", + "ES2018.Intl", + "ES2018.Promise", + "ES2018.Regexp", + "ES2019", + "ES2019.Array", + "ES2019.Intl", + "ES2019.Object", + "ES2019.String", + "ES2019.Symbol", + "ES2020", + "ES2020.BigInt", + "ES2020.Promise", + "ES2020.String", + "ES2020.Symbol.WellKnown", + "ESNext", + "ESNext.Array", + "ESNext.AsyncIterable", + "ESNext.BigInt", + "ESNext.Collection", + "ESNext.Intl", + "ESNext.Iterator", + "ESNext.Object", + "ESNext.Promise", + "ESNext.Regexp", + "ESNext.String", + "ESNext.Symbol", + "DOM", + "DOM.AsyncIterable", + "DOM.Iterable", + "ScriptHost", + "WebWorker", + "WebWorker.AsyncIterable", + "WebWorker.ImportScripts", + "Webworker.Iterable", + "ES7", + "ES2021", + "ES2020.SharedMemory", + "ES2020.Intl", + "ES2020.Date", + "ES2020.Number", + "ES2021.Promise", + "ES2021.String", + "ES2021.WeakRef", + "ESNext.WeakRef", + "ES2021.Intl", + "ES2022", + "ES2022.Array", + "ES2022.Error", + "ES2022.Intl", + "ES2022.Object", + "ES2022.String", + "ES2022.SharedMemory", + "ES2022.RegExp", + "ES2023", + "ES2023.Array", + "ES2024", + "ES2024.ArrayBuffer", + "ES2024.Collection", + "ES2024.Object", + "ES2024.Promise", + "ES2024.Regexp", + "ES2024.SharedMemory", + "ES2024.String", + "Decorators", + "Decorators.Legacy", + "ES2017.Date", + "ES2023.Collection", + "ESNext.Decorators", + "ESNext.Disposable", + "ESNext.Error", + "ESNext.Sharedmemory" + ] + }, + { + "pattern": "^[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]7$" + }, + { + "pattern": "^[Ee][Ss]2015(\\.([Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Cc][Oo][Rr][Ee]|[Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Pp][Rr][Oo][Xx][Yy]|[Rr][Ee][Ff][Ll][Ee][Cc][Tt]|[Ss][Yy][Mm][Bb][Oo][Ll]\\.[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$" + }, + { + "pattern": "^[Ee][Ss]2016(\\.[Aa][Rr][Rr][Aa][Yy]\\.[Ii][Nn][Cc][Ll][Uu][Dd][Ee])?$" + }, + { + "pattern": "^[Ee][Ss]2017(\\.([Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Tt][Yy][Pp][Ee][Dd][Aa][Rr][Rr][Aa][Yy][Ss]|[Dd][Aa][Tt][Ee]|[Aa][Rr][Rr][Aa][Yy][Bb][Uu][Ff][Ff][Ee][Rr]))?$" + }, + { + "pattern": "^[Ee][Ss]2018(\\.([Aa][Ss][Yy][Nn][Cc][Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Rr][Ee][Gg][Ee][Xx][Pp]))?$" + }, + { + "pattern": "^[Ee][Ss]2019(\\.([Aa][Rr][Rr][Aa][Yy]|[Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$" + }, + { + "pattern": "^[Ee][Ss]2020(\\.([Bb][Ii][Gg][Ii][Nn][Tt]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]\\.[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ii][Nn][Tt][Ll]|[Dd][Aa][Tt][Ee]|[Nn][Uu][Mm][Bb][Ee][Rr]))?$" + }, + { + "pattern": "^[Ee][Ss]2021(\\.([Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]))?$" + }, + { + "pattern": "^[Ee][Ss]2022(\\.([Aa][Rr][Rr][Aa][Yy]|[Ee][Rr][Rr][Oo][Rr]|[Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Rr][Ee][Gg][Ee][Xx][Pp]))?$" + }, + { + "pattern": "^[Ee][Ss]2023(\\.([Aa][Rr][Rr][Aa][Yy]|[Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]))?$" + }, + { + "pattern": "^[Ee][Ss]2024(\\.([Aa][Rr][Rr][Aa][Yy][Bb][Uu][Ff][Ff][Ee][Rr]|[Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Rr][Ee][Gg][Ee][Xx][Pp]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ss][Tt][Rr][Ii][Nn][Gg]))?$" + }, + { + "pattern": "^[Ee][Ss][Nn][Ee][Xx][Tt](\\.([Aa][Rr][Rr][Aa][Yy]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Bb][Ii][Gg][Ii][Nn][Tt]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]|[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss]|[Dd][Ii][Ss][Pp][Oo][Ss][Aa][Bb][Ll][Ee]))?$" + }, + { + "pattern": "^[Dd][Oo][Mm](\\.([Aa][Ss][Yy][Nn][Cc])?[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee])?$" + }, + { + "pattern": "^[Ss][Cc][Rr][Ii][Pp][Tt][Hh][Oo][Ss][Tt]$" + }, + { + "pattern": "^[Ww][Ee][Bb][Ww][Oo][Rr][Kk][Ee][Rr](\\.([Ii][Mm][Pp][Oo][Rr][Tt][Ss][Cc][Rr][Ii][Pp][Tt][Ss]|([Aa][Ss][Yy][Nn][Cc])?[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]))?$" + }, + { + "pattern": "^[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss](\\.([Ll][Ee][Gg][Aa][Cc][Yy]))?$" + } + ] + }, + "markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib" + }, + "libReplacement": { + "description": "Enable lib replacement.", + "type": [ + "boolean", + "null" + ], + "default": true, + "markdownDescription": "Enable lib replacement.\n\nSee more: https://www.typescriptlang.org/tsconfig#libReplacement" + }, + "moduleDetection": { + "description": "Control what method is used to detect module-format JS files.", + "enum": [ + "auto", + "legacy", + "force" + ], + "markdownDescription": "Control what method is used to detect module-format JS files.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleDetection" + }, + "strictNullChecks": { + "description": "When type checking, take into account `null` and `undefined`.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "When type checking, take into account `null` and `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictNullChecks" + }, + "maxNodeModuleJsDepth": { + "description": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.", + "type": [ + "number", + "null" + ], + "default": 0, + "markdownDescription": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.\n\nSee more: https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth" + }, + "importHelpers": { + "description": "Allow importing helper functions from tslib once per project, instead of including them per-file.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Allow importing helper functions from tslib once per project, instead of including them per-file.\n\nSee more: https://www.typescriptlang.org/tsconfig#importHelpers" + }, + "importsNotUsedAsValues": { + "description": "Specify emit/checking behavior for imports that are only used for types.", + "default": "remove", + "enum": [ + "remove", + "preserve", + "error" + ], + "markdownDescription": "Specify emit/checking behavior for imports that are only used for types.\n\nSee more: https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues" + }, + "alwaysStrict": { + "description": "Ensure `use strict` is always emitted.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Ensure `use strict` is always emitted.\n\nSee more: https://www.typescriptlang.org/tsconfig#alwaysStrict" + }, + "strict": { + "description": "Enable all strict type-checking options.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable all strict type-checking options.\n\nSee more: https://www.typescriptlang.org/tsconfig#strict" + }, + "strictBindCallApply": { + "description": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBindCallApply" + }, + "downlevelIteration": { + "description": "Emit more compliant, but verbose and less performant JavaScript for iteration.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Emit more compliant, but verbose and less performant JavaScript for iteration.\n\nSee more: https://www.typescriptlang.org/tsconfig#downlevelIteration" + }, + "checkJs": { + "description": "Enable error reporting in type-checked JavaScript files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable error reporting in type-checked JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#checkJs" + }, + "strictFunctionTypes": { + "description": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes" + }, + "strictPropertyInitialization": { + "description": "Check for class properties that are declared but not set in the constructor.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization" + }, + "esModuleInterop": { + "description": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.\n\nSee more: https://www.typescriptlang.org/tsconfig#esModuleInterop" + }, + "allowUmdGlobalAccess": { + "description": "Allow accessing UMD globals from modules.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Allow accessing UMD globals from modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUmdGlobalAccess" + }, + "keyofStringsOnly": { + "description": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.\n\nSee more: https://www.typescriptlang.org/tsconfig#keyofStringsOnly" + }, + "useDefineForClassFields": { + "description": "Emit ECMAScript-standard-compliant class fields.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Emit ECMAScript-standard-compliant class fields.\n\nSee more: https://www.typescriptlang.org/tsconfig#useDefineForClassFields" + }, + "declarationMap": { + "description": "Create sourcemaps for d.ts files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Create sourcemaps for d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationMap" + }, + "resolveJsonModule": { + "description": "Enable importing .json files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Enable importing .json files.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolveJsonModule" + }, + "resolvePackageJsonExports": { + "description": "Use the package.json 'exports' field when resolving package imports.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Use the package.json 'exports' field when resolving package imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonExports" + }, + "resolvePackageJsonImports": { + "description": "Use the package.json 'imports' field when resolving imports.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Use the package.json 'imports' field when resolving imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonImports" + }, + "assumeChangesOnlyAffectDirectDependencies": { + "description": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.\n\nSee more: https://www.typescriptlang.org/tsconfig#assumeChangesOnlyAffectDirectDependencies" + }, + "extendedDiagnostics": { + "description": "Output more detailed compiler performance information after building.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Output more detailed compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#extendedDiagnostics" + }, + "listFilesOnly": { + "description": "Print names of files that are part of the compilation and then stop processing.", + "type": [ + "boolean", + "null" + ] + }, + "disableSourceOfProjectReferenceRedirect": { + "description": "Disable preferring source files instead of declaration files when referencing composite projects.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Disable preferring source files instead of declaration files when referencing composite projects.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSourceOfProjectReferenceRedirect" + }, + "disableSolutionSearching": { + "description": "Opt a project out of multi-project reference checking when editing.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Opt a project out of multi-project reference checking when editing.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSolutionSearching" + }, + "verbatimModuleSyntax": { + "description": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the `module` setting.", + "type": [ + "boolean", + "null" + ], + "markdownDescription": "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the `module` setting.\n\nSee more: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax" + }, + "noCheck": { + "description": "Disable full type checking (only critical parse and emit errors will be reported).", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Disable full type checking (only critical parse and emit errors will be reported).\n\nSee more: https://www.typescriptlang.org/tsconfig#noCheck" + }, + "isolatedDeclarations": { + "description": "Require sufficient annotation on exports so other tools can trivially generate declaration files.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Require sufficient annotation on exports so other tools can trivially generate declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedDeclarations" + }, + "noUncheckedSideEffectImports": { + "description": "Check side effect imports.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Check side effect imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedSideEffectImports" + }, + "strictBuiltinIteratorReturn": { + "description": "Built-in iterators are instantiated with a `TReturn` type of `undefined` instead of `any`.", + "type": [ + "boolean", + "null" + ], + "default": false, + "markdownDescription": "Built-in iterators are instantiated with a `TReturn` type of `undefined` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBuiltinIteratorReturn" + } + } + } + } + }, + "typeAcquisitionDefinition": { + "properties": { + "typeAcquisition": { + "type": [ + "object", + "null" + ], + "description": "Auto type (.d.ts) acquisition options for this project. Requires TypeScript version 2.1 or later.", + "properties": { + "enable": { + "description": "Enable auto type acquisition", + "type": [ + "boolean", + "null" + ], + "default": false + }, + "include": { + "description": "Specifies a list of type declarations to be included in auto type acquisition. Ex. [\"jquery\", \"lodash\"]", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "exclude": { + "description": "Specifies a list of type declarations to be excluded from auto type acquisition. Ex. [\"jquery\", \"lodash\"]", + "type": [ + "array", + "null" + ], + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + } + } + }, + "referencesDefinition": { + "properties": { + "references": { + "type": "array", + "uniqueItems": true, + "description": "Referenced projects. Requires TypeScript version 3.0 or later.", + "items": { + "type": "object", + "description": "Project reference.", + "properties": { + "path": { + "type": "string", + "description": "Path to referenced tsconfig or to folder containing tsconfig." + } + } + } + } + } + }, + "tsNodeModuleTypes": { + "type": [ + "object", + "null" + ] + }, + "tsNodeDefinition": { + "properties": { + "ts-node": { + "description": "ts-node options. See also: https://typestrong.org/ts-node/docs/configuration\n\nts-node offers TypeScript execution and REPL for node.js, with source map support.", + "properties": { + "compiler": { + "default": "typescript", + "description": "Specify a custom TypeScript compiler.", + "type": [ + "string", + "null" + ] + }, + "compilerHost": { + "default": false, + "description": "Use TypeScript's compiler host API instead of the language service API.", + "type": [ + "boolean", + "null" + ] + }, + "compilerOptions": { + "additionalProperties": true, + "allOf": [ + { + "$ref": "#/definitions/compilerOptionsDefinition/properties/compilerOptions" + } + ], + "description": "JSON object to merge with TypeScript `compilerOptions`.", + "properties": {}, + "type": [ + "object", + "null" + ] + }, + "emit": { + "default": false, + "description": "Emit output files into `.ts-node` directory.", + "type": [ + "boolean", + "null" + ] + }, + "esm": { + "description": "Enable native ESM support.\n\nFor details, see https://typestrong.org/ts-node/docs/imports#native-ecmascript-modules", + "type": [ + "boolean", + "null" + ] + }, + "experimentalReplAwait": { + "description": "Allows the usage of top level await in REPL.\n\nUses node's implementation which accomplishes this with an AST syntax transformation.\n\nEnabled by default when tsconfig target is es2018 or above. Set to false to disable.\n\n**Note**: setting to `true` when tsconfig target is too low will throw an Error. Leave as `undefined`\nto get default, automatic behavior.", + "type": [ + "boolean", + "null" + ] + }, + "experimentalResolver": { + "description": "Enable experimental features that re-map imports and require calls to support:\n`baseUrl`, `paths`, `rootDirs`, `.js` to `.ts` file extension mappings,\n`outDir` to `rootDir` mappings for composite projects and monorepos.\n\nFor details, see https://github.com/TypeStrong/ts-node/issues/1514", + "type": [ + "boolean", + "null" + ] + }, + "experimentalSpecifierResolution": { + "description": "Like node's `--experimental-specifier-resolution`, , but can also be set in your `tsconfig.json` for convenience.\n\nFor details, see https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#customizing-esm-specifier-resolution-algorithm", + "enum": [ + "explicit", + "node" + ], + "type": [ + "string", + "null" + ] + }, + "files": { + "default": false, + "description": "Load \"files\" and \"include\" from `tsconfig.json` on startup.\n\nDefault is to override `tsconfig.json` \"files\" and \"include\" to only include the entrypoint script.", + "type": [ + "boolean", + "null" + ] + }, + "ignore": { + "default": [ + "(?:^|/)node_modules/" + ], + "description": "Paths which should not be compiled.\n\nEach string in the array is converted to a regular expression via `new RegExp()` and tested against source paths prior to compilation.\n\nSource paths are normalized to posix-style separators, relative to the directory containing `tsconfig.json` or to cwd if no `tsconfig.json` is loaded.\n\nDefault is to ignore all node_modules subdirectories.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "ignoreDiagnostics": { + "description": "Ignore TypeScript warnings by diagnostic code.", + "items": { + "type": [ + "string", + "number" + ] + }, + "type": [ + "array", + "null" + ] + }, + "logError": { + "default": false, + "description": "Logs TypeScript errors to stderr instead of throwing exceptions.", + "type": [ + "boolean", + "null" + ] + }, + "moduleTypes": { + "$ref": "#/definitions/tsNodeModuleTypes", + "description": "Override certain paths to be compiled and executed as CommonJS or ECMAScript modules.\nWhen overridden, the tsconfig \"module\" and package.json \"type\" fields are overridden, and\nthe file extension is ignored.\nThis is useful if you cannot use .mts, .cts, .mjs, or .cjs file extensions;\nit achieves the same effect.\n\nEach key is a glob pattern following the same rules as tsconfig's \"include\" array.\nWhen multiple patterns match the same file, the last pattern takes precedence.\n\n`cjs` overrides matches files to compile and execute as CommonJS.\n`esm` overrides matches files to compile and execute as native ECMAScript modules.\n`package` overrides either of the above to default behavior, which obeys package.json \"type\" and\ntsconfig.json \"module\" options." + }, + "preferTsExts": { + "default": false, + "description": "Re-order file extensions so that TypeScript imports are preferred.\n\nFor example, when both `index.js` and `index.ts` exist, enabling this option causes `require('./index')` to resolve to `index.ts` instead of `index.js`", + "type": [ + "boolean", + "null" + ] + }, + "pretty": { + "default": false, + "description": "Use pretty diagnostic formatter.", + "type": [ + "boolean", + "null" + ] + }, + "require": { + "description": "Modules to require, like node's `--require` flag.\n\nIf specified in `tsconfig.json`, the modules will be resolved relative to the `tsconfig.json` file.\n\nIf specified programmatically, each input string should be pre-resolved to an absolute path for\nbest results.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "scope": { + "default": false, + "description": "Scope compiler to files within `scopeDir`.", + "type": [ + "boolean", + "null" + ] + }, + "scopeDir": { + "default": "First of: `tsconfig.json` \"rootDir\" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.", + "type": [ + "string", + "null" + ] + }, + "skipIgnore": { + "default": false, + "description": "Skip ignore check, so that compilation will be attempted for all files with matching extensions.", + "type": [ + "boolean", + "null" + ] + }, + "swc": { + "description": "Transpile with swc instead of the TypeScript compiler, and skip typechecking.\n\nEquivalent to setting both `transpileOnly: true` and `transpiler: 'ts-node/transpilers/swc'`\n\nFor complete instructions: https://typestrong.org/ts-node/docs/transpilers", + "type": [ + "boolean", + "null" + ] + }, + "transpileOnly": { + "default": false, + "description": "Use TypeScript's faster `transpileModule`.", + "type": [ + "boolean", + "null" + ] + }, + "transpiler": { + "anyOf": [ + { + "items": [ + { + "type": [ + "string", + "null" + ] + }, + { + "additionalProperties": true, + "properties": {}, + "type": [ + "object", + "null" + ] + } + ], + "maxItems": 2, + "minItems": 2, + "type": [ + "array", + "null" + ] + }, + { + "type": [ + "string", + "null" + ] + } + ], + "description": "Specify a custom transpiler for use with transpileOnly" + }, + "typeCheck": { + "default": true, + "description": "**DEPRECATED** Specify type-check is enabled (e.g. `transpileOnly == false`).", + "type": [ + "boolean", + "null" + ] + } + }, + "type": [ + "object", + "null" + ] + } + } + }, + "effectLanguageServicePluginDiagnosticSeverityDefinition": { + "type": "object", + "description": "Allows overriding the default severity for each Effect diagnostic across the project.", + "additionalProperties": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ] + }, + "properties": { + "anyUnknownInErrorContext": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Detects 'any' or 'unknown' types in Effect error or requirements channels Default severity: off." + }, + "catchAllToMapError": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Effect.mapError instead of Effect.catchAll when the callback only wraps the error with Effect.fail Default severity: suggestion." + }, + "catchUnfailableEffect": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Warns when using error handling on Effects that never fail (error type is 'never') Default severity: suggestion." + }, + "classSelfMismatch": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Ensures Self type parameter matches the class name in Service/Tag/Schema classes Default severity: error." + }, + "deterministicKeys": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Enforces deterministic naming for service/tag/error identifiers based on class names Default severity: off." + }, + "duplicatePackage": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Detects when multiple versions of the same Effect package are loaded Default severity: warning." + }, + "effectFnIife": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Effect.fn or Effect.fnUntraced is called as an IIFE (Immediately Invoked Function Expression). Use Effect.gen instead. Default severity: warning." + }, + "effectFnOpportunity": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Effect.fn for functions that returns an Effect Default severity: suggestion." + }, + "effectGenUsesAdapter": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns when using the deprecated adapter parameter in Effect.gen Default severity: warning." + }, + "effectInFailure": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns when an Effect is used inside an Effect failure channel Default severity: warning." + }, + "effectInVoidSuccess": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Detects nested Effects in void success channels that may cause unexecuted effects Default severity: warning." + }, + "effectMapVoid": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Effect.asVoid instead of Effect.map(() => void 0), Effect.map(() => undefined), or Effect.map(() => {}) Default severity: suggestion." + }, + "effectSucceedWithVoid": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Effect.void instead of Effect.succeed(undefined) or Effect.succeed(void 0) Default severity: suggestion." + }, + "extendsNativeError": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Warns when a class directly extends the native Error class Default severity: off." + }, + "floatingEffect": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Ensures Effects are yielded or assigned to variables, not left floating Default severity: error." + }, + "genericEffectServices": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Prevents services with type parameters that cannot be discriminated at runtime Default severity: warning." + }, + "globalErrorInEffectCatch": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns when catch callbacks return global Error type instead of typed errors Default severity: warning." + }, + "globalErrorInEffectFailure": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns when the global Error type is used in an Effect failure channel Default severity: warning." + }, + "importFromBarrel": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Suggests importing from specific module paths instead of barrel exports Default severity: off." + }, + "instanceOfSchema": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Suggests using Schema.is instead of instanceof for Effect Schema types Default severity: off." + }, + "layerMergeAllWithDependencies": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Detects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires Default severity: warning." + }, + "leakingRequirements": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Detects implementation services leaked in service methods Default severity: suggestion." + }, + "missedPipeableOpportunity": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Enforces the use of pipeable style for nested function calls Default severity: off." + }, + "missingEffectContext": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Reports missing service requirements in Effect context channel Default severity: error." + }, + "missingEffectError": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Reports missing error types in Effect error channel Default severity: error." + }, + "missingEffectServiceDependency": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Checks that Effect.Service dependencies satisfy all required layer inputs Default severity: off." + }, + "missingLayerContext": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Reports missing service requirements in Layer context channel Default severity: error." + }, + "missingReturnYieldStar": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Suggests using 'return yield*' for Effects with never success for better type narrowing Default severity: error." + }, + "missingStarInYieldEffectGen": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Enforces using 'yield*' instead of 'yield' when yielding Effects in generators Default severity: error." + }, + "multipleEffectProvide": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns against chaining Effect.provide calls which can cause service lifecycle issues Default severity: warning." + }, + "nodeBuiltinImport": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Warns when importing Node.js built-in modules that have Effect-native counterparts Default severity: off." + }, + "nonObjectEffectServiceType": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Ensures Effect.Service types are objects, not primitives Default severity: error." + }, + "outdatedApi": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Detects usage of APIs that have been removed or renamed in Effect v4 Default severity: warning." + }, + "outdatedEffectCodegen": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Detects when generated code is outdated and needs to be regenerated Default severity: warning." + }, + "overriddenSchemaConstructor": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "error", + "description": "Prevents overriding constructors in Schema classes which breaks decoding behavior Default severity: error." + }, + "preferSchemaOverJson": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify which may throw Default severity: suggestion." + }, + "redundantSchemaTagIdentifier": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests removing redundant identifier argument when it equals the tag value in Schema.TaggedClass/TaggedError/TaggedRequest Default severity: suggestion." + }, + "returnEffectInGen": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Warns when returning an Effect in a generator causes nested Effect> Default severity: suggestion." + }, + "runEffectInsideEffect": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Runtime methods instead of Effect.run* inside Effect contexts Default severity: suggestion." + }, + "schemaStructWithTag": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Schema.TaggedStruct instead of Schema.Struct with _tag field Default severity: suggestion." + }, + "schemaSyncInEffect": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests using Effect-based Schema methods instead of sync methods inside Effect generators Default severity: suggestion." + }, + "schemaUnionOfLiterals": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Simplifies Schema.Union of multiple Schema.Literal calls into single Schema.Literal Default severity: off." + }, + "scopeInLayerEffect": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Suggests using Layer.scoped instead of Layer.effect when Scope is in requirements Default severity: warning." + }, + "serviceNotAsClass": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Warns when ServiceMap.Service is used as a variable instead of a class declaration Default severity: off." + }, + "strictBooleanExpressions": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Enforces boolean types in conditional expressions for type safety Default severity: off." + }, + "strictEffectProvide": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "off", + "description": "Warns when using Effect.provide with layers outside of application entry points Default severity: off." + }, + "tryCatchInEffectGen": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Discourages try/catch in Effect generators in favor of Effect error handling Default severity: suggestion." + }, + "unknownInEffectCatch": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns when catch callbacks return unknown instead of typed errors Default severity: warning." + }, + "unnecessaryEffectGen": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests removing Effect.gen when it contains only a single return statement Default severity: suggestion." + }, + "unnecessaryFailYieldableError": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Suggests yielding yieldable errors directly instead of wrapping with Effect.fail Default severity: suggestion." + }, + "unnecessaryPipe": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Removes pipe calls with no arguments Default severity: suggestion." + }, + "unnecessaryPipeChain": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "suggestion", + "description": "Simplifies chained pipe calls into a single pipe call Default severity: suggestion." + }, + "unsupportedServiceAccessors": { + "type": "string", + "enum": [ + "off", + "error", + "warning", + "message", + "suggestion" + ], + "default": "warning", + "description": "Warns about service accessors that need codegen due to generic/complex signatures Default severity: warning." + } + } + } + }, + "id": "https://json.schemastore.org/tsconfig", + "title": "JSON schema for the TypeScript compiler's configuration file", + "type": "object" +}