From 996903a1ece5dd2f82000d70a76ff93e00847674 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 13 Feb 2026 09:14:32 -0800 Subject: [PATCH 01/20] Update files list for TS6 --- .changeset/poor-bears-hear.md | 5 +++++ packages/typescript-vfs/src/index.ts | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .changeset/poor-bears-hear.md diff --git a/.changeset/poor-bears-hear.md b/.changeset/poor-bears-hear.md new file mode 100644 index 000000000000..d1692b5be099 --- /dev/null +++ b/.changeset/poor-bears-hear.md @@ -0,0 +1,5 @@ +--- +"@typescript/vfs": patch +--- + +Update lib files list diff --git a/packages/typescript-vfs/src/index.ts b/packages/typescript-vfs/src/index.ts index 11f0c0e2e43c..7c1b59560370 100755 --- a/packages/typescript-vfs/src/index.ts +++ b/packages/typescript-vfs/src/index.ts @@ -221,13 +221,23 @@ export const knownLibFilesForCompilerOptions = (compilerOptions: CompilerOptions "lib.es2024.regexp.d.ts", "lib.es2024.sharedmemory.d.ts", "lib.es2024.string.d.ts", + "lib.es2025.collection.d.ts", + "lib.es2025.d.ts", + "lib.es2025.float16.d.ts", + "lib.es2025.full.d.ts", + "lib.es2025.intl.d.ts", + "lib.es2025.iterator.d.ts", + "lib.es2025.promise.d.ts", + "lib.es2025.regexp.d.ts", "lib.esnext.array.d.ts", "lib.esnext.asynciterable.d.ts", "lib.esnext.bigint.d.ts", "lib.esnext.collection.d.ts", "lib.esnext.d.ts", + "lib.esnext.date.d.ts", "lib.esnext.decorators.d.ts", "lib.esnext.disposable.d.ts", + "lib.esnext.error.d.ts", "lib.esnext.float16.d.ts", "lib.esnext.full.d.ts", "lib.esnext.intl.d.ts", @@ -235,8 +245,11 @@ export const knownLibFilesForCompilerOptions = (compilerOptions: CompilerOptions "lib.esnext.object.d.ts", "lib.esnext.promise.d.ts", "lib.esnext.regexp.d.ts", + "lib.esnext.sharedmemory.d.ts", "lib.esnext.string.d.ts", "lib.esnext.symbol.d.ts", + "lib.esnext.temporal.d.ts", + "lib.esnext.typedarrays.d.ts", "lib.esnext.weakref.d.ts" ] From ef42a36dc4ff9d06a2ccb99ebac6cc608f3b9db0 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 13 Feb 2026 10:21:01 -0800 Subject: [PATCH 02/20] Update stuff --- package.json | 4 +- packages/ata/tsconfig.json | 4 +- .../en/project-config/Compiler Options.md | 41 +- packages/glossary/scripts/generateMarkdown.ts | 2 +- packages/playground-worker/tsconfig.json | 4 +- packages/playground/tsconfig.json | 1 + packages/sandbox/tsconfig.json | 1 + packages/ts-twoslasher/tsconfig.json | 5 +- packages/tsconfig-reference/data/_types.ts | 1 + .../scripts/cli/generateJSON.ts | 16 +- .../scripts/cli/generateMarkdown.ts | 6 +- .../scripts/msbuild/generateJSON.ts | 8 +- .../scripts/msbuild/generateMarkdown.ts | 3 +- .../scripts/schema/downloadSchemaBase.ts | 4 +- .../scripts/schema/generateJSON.ts | 22 +- .../scripts/schema/result/schema.json | 3 +- .../scripts/tsconfig/generateJSON.ts | 20 +- .../scripts/tsconfig/generateMarkdown.ts | 18 +- .../scripts/tsconfigRules.ts | 14 +- packages/tsconfig-reference/tsconfig.json | 2 +- packages/typescript-vfs/tsconfig.json | 5 +- pnpm-lock.yaml | 462 +++++++++--------- 22 files changed, 330 insertions(+), 316 deletions(-) diff --git a/package.json b/package.json index 21b31ec901ee..bef51cdaad76 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "@types/estree": "0.0.46", "@types/eslint": "7.29.0", "assert": "2.0.0", - "rollup-plugin-typescript2": "0.34.1", - "typescript": "5.9.2", + "rollup-plugin-typescript2": "0.36.0", + "typescript": "6.0.0-dev.20260204", "tslib": "^2.6.2", "prettier": "^2.0.2", "sharp": "0.28.1" diff --git a/packages/ata/tsconfig.json b/packages/ata/tsconfig.json index e228c47e9e33..8ca940e926de 100644 --- a/packages/ata/tsconfig.json +++ b/packages/ata/tsconfig.json @@ -1,11 +1,11 @@ { "compilerOptions": { "module": "ESNext", - "moduleResolution": "node", + "moduleResolution": "bundler", "strict": true, "noUncheckedIndexedAccess": true, "target": "ES2015", "declaration": false, "noEmit": true } -} \ No newline at end of file +} diff --git a/packages/documentation/copy/en/project-config/Compiler Options.md b/packages/documentation/copy/en/project-config/Compiler Options.md index 72eaa57dc7f3..c83c66b5135a 100644 --- a/packages/documentation/copy/en/project-config/Compiler Options.md +++ b/packages/documentation/copy/en/project-config/Compiler Options.md @@ -63,57 +63,66 @@ tsc app.ts util.ts --target esnext --outfile index.js

Gives local information for help on the CLI.

- - --init + + --ignoreConfig

boolean

+

Ignore the tsconfig found and build with commandline options and files.

+ + + + --init +

boolean

+ + +

Initializes a TypeScript project and creates a tsconfig.json file.

- + --listFilesOnly

boolean

- +

Print names of files that are part of the compilation and then stop processing.

- + --locale

string

- +

Set the language of the messaging from TypeScript. This does not affect emit.

- + --project

string

- +

Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.

- + --showConfig

boolean

- +

Print the final configuration instead of building.

- + --version

boolean

- +

Print the compiler's version.

@@ -285,7 +294,7 @@ tsc app.ts util.ts --target esnext --outfile index.js --allowJs

boolean

-

false

+

false, unless checkJs is set

@@ -791,7 +800,7 @@ tsc app.ts util.ts --target esnext --outfile index.js --libReplacement

boolean

-

true

+

false

@@ -1077,7 +1086,7 @@ tsc app.ts util.ts --target esnext --outfile index.js --noUncheckedSideEffectImports

boolean

-

false

+

true

@@ -1363,7 +1372,7 @@ tsc app.ts util.ts --target esnext --outfile index.js --strict

boolean

-

false

+

true

diff --git a/packages/glossary/scripts/generateMarkdown.ts b/packages/glossary/scripts/generateMarkdown.ts index 78c012079d48..05e3d62119ac 100644 --- a/packages/glossary/scripts/generateMarkdown.ts +++ b/packages/glossary/scripts/generateMarkdown.ts @@ -32,7 +32,7 @@ languages.forEach((lang) => { const locale = join(__dirname, "..", "copy", lang); const fallbackLocale = join(__dirname, "..", "copy", "en"); - const languageMeta = { terms: [] }; + const languageMeta: { terms: { display: string; id: string }[] } = { terms: [] }; const markdownChunks: string[] = []; const glossaryTerms = readdirSync(join(__dirname, "..", "copy", "en")).filter( diff --git a/packages/playground-worker/tsconfig.json b/packages/playground-worker/tsconfig.json index ff340edec22b..bfe69714fdfb 100644 --- a/packages/playground-worker/tsconfig.json +++ b/packages/playground-worker/tsconfig.json @@ -5,6 +5,6 @@ "target": "ES2020", "allowJs": false, "module": "esnext", - "moduleResolution": "node" + "moduleResolution": "bundler" } -} \ No newline at end of file +} diff --git a/packages/playground/tsconfig.json b/packages/playground/tsconfig.json index 885a5495a406..c97482469733 100644 --- a/packages/playground/tsconfig.json +++ b/packages/playground/tsconfig.json @@ -1,6 +1,7 @@ { "include": ["src"], "compilerOptions": { + "ignoreDeprecations": "6.0", "outDir": "../typescriptlang-org/static/js/playground", "jsx": "react", "target": "ES2016", diff --git a/packages/sandbox/tsconfig.json b/packages/sandbox/tsconfig.json index 2612cde3e8a0..769aaf13c8c6 100644 --- a/packages/sandbox/tsconfig.json +++ b/packages/sandbox/tsconfig.json @@ -2,6 +2,7 @@ "include": ["src", "src/vendor/lzstring.min.js"], "compilerOptions": { + "ignoreDeprecations": "6.0", "outDir": "../typescriptlang-org/static/js/sandbox", "target": "ES2016", "module": "AMD", diff --git a/packages/ts-twoslasher/tsconfig.json b/packages/ts-twoslasher/tsconfig.json index bd2865763b5b..f622ae090705 100644 --- a/packages/ts-twoslasher/tsconfig.json +++ b/packages/ts-twoslasher/tsconfig.json @@ -20,10 +20,9 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", - "baseUrl": "./src", + "moduleResolution": "bundler", "paths": { - "*": ["src/*", "node_modules/*"] + "*": ["./src/*", "./node_modules/*"] }, "jsx": "react", "esModuleInterop": true diff --git a/packages/tsconfig-reference/data/_types.ts b/packages/tsconfig-reference/data/_types.ts index 1b10e7de3e1d..fa1709e2ba34 100644 --- a/packages/tsconfig-reference/data/_types.ts +++ b/packages/tsconfig-reference/data/_types.ts @@ -30,6 +30,7 @@ export type CompilerOptionName = | "project" | "showConfig" | "listFilesOnly" + | "ignoreConfig" | "target" | "module" | "lib" diff --git a/packages/tsconfig-reference/scripts/cli/generateJSON.ts b/packages/tsconfig-reference/scripts/cli/generateJSON.ts index 1af3baa73109..3a0a65ff2f92 100644 --- a/packages/tsconfig-reference/scripts/cli/generateJSON.ts +++ b/packages/tsconfig-reference/scripts/cli/generateJSON.ts @@ -22,11 +22,11 @@ import { } from "../tsconfigRules.js"; import { CompilerOptionName } from "../../data/_types"; -const toJSONString = (obj) => +const toJSONString = (obj: any) => prettier.format(JSON.stringify(obj, null, " "), { filepath: "thing.json" }); -const writeJSON = (name, obj) => +const writeJSON = (name: string, obj: any) => writeFileSync(new URL(`../../data/${name}`, import.meta.url), toJSONString(obj)); -const writeString = (name, text) => +const writeString = (name: string, text: string) => writeFileSync( new URL(`../../data/${name}`, import.meta.url), prettier.format(text, { filepath: name }) @@ -44,7 +44,7 @@ export interface CompilerOptionJSON extends CommandLineOptionBase { hostObj: string; } -const tsconfigOpts = JSON.parse(readFileSync(join("data", "tsconfigOpts.json"), "utf8")); +const tsconfigOpts: CompilerOptionJSON[] = JSON.parse(readFileSync(join("data", "tsconfigOpts.json"), "utf8")); const notCompilerFlags = [ // @ts-ignore @@ -73,7 +73,7 @@ filteredOptions.forEach((option) => { // Convert JS Map types to a JSONable obj if ("type" in option && typeof option.type === "object" && "get" in option.type) { // Option definitely has a map obj, need to resolve it - const newOptions = {}; + const newOptions: Record = {}; option.type.forEach((v, k) => (newOptions[k] = v)); // @ts-ignore option.type = newOptions; @@ -88,15 +88,15 @@ filteredOptions.forEach((option) => { } if (name in allowedValues) { - option.allowedValues = allowedValues[name]; + option.allowedValues = (allowedValues as any)[name]; } if (name in configToRelease) { - option.releaseVersion = configToRelease[name]; + option.releaseVersion = (configToRelease as any)[name]; } if (name in defaultsForOptions) { - const defaultValue = defaultsForOptions[name]; + const defaultValue = (defaultsForOptions as any)[name]; option.defaultValue = Array.isArray(defaultValue) ? defaultValue.join(" ") : defaultValue; } diff --git a/packages/tsconfig-reference/scripts/cli/generateMarkdown.ts b/packages/tsconfig-reference/scripts/cli/generateMarkdown.ts index 82ef44d058fa..47b845509a9a 100644 --- a/packages/tsconfig-reference/scripts/cli/generateMarkdown.ts +++ b/packages/tsconfig-reference/scripts/cli/generateMarkdown.ts @@ -15,7 +15,7 @@ import prettier from "prettier"; import { CompilerOptionJSON } from "./generateJSON.js"; import { parseMarkdown } from "../tsconfigRules.js"; -const cliOpts = JSON.parse(readFileSync(join("data", "cliOpts.json"), "utf8")); +const cliOpts: Record = JSON.parse(readFileSync(join("data", "cliOpts.json"), "utf8")); const knownTypes: Record = {}; @@ -107,14 +107,14 @@ languages.forEach((lang) => { markdownChunks.push(` ${parseMarkdown(optType)}`); if (!opts?.noDefaults) { - markdownChunks.push(` ${parseMarkdown(option.defaultValue)}`); + markdownChunks.push(` ${parseMarkdown(option.defaultValue ?? "")}`); } markdownChunks.push(``); // Add a new row under the current one for the description, this uses the 'odd' / 'even' classes // to fake looking like a single row markdownChunks.push(``); - markdownChunks.push(`${parseMarkdown(description)}`.trim()); + markdownChunks.push(`${parseMarkdown(description ?? "")}`.trim()); markdownChunks.push(`\n`); }); markdownChunks.push(`\n`); diff --git a/packages/tsconfig-reference/scripts/msbuild/generateJSON.ts b/packages/tsconfig-reference/scripts/msbuild/generateJSON.ts index 7654f09cb896..bb4e42159b4c 100644 --- a/packages/tsconfig-reference/scripts/msbuild/generateJSON.ts +++ b/packages/tsconfig-reference/scripts/msbuild/generateJSON.ts @@ -7,9 +7,9 @@ import { readFileSync, writeFileSync } from "fs"; import { join } from "path"; import prettier from "prettier"; -const toJSONString = (obj) => +const toJSONString = (obj: any) => prettier.format(JSON.stringify(obj, null, " "), { filepath: "thing.json" }); -const writeJSON = (name, obj) => +const writeJSON = (name: string, obj: any) => writeFileSync( new URL(`../../data/${name}`, import.meta.url), toJSONString(obj) @@ -34,10 +34,10 @@ if (!config) { const skip = ["TypeScriptCodePage", "TypeScriptExperimentalAsyncFunctions", "TypeScriptOutFile"]; -const json = config.TypeScriptBuildConfigurations.map((config) => { +const json = config.TypeScriptBuildConfigurations!.map((config) => { const tscCLIName = config._text.includes("--") && config._text.trim().slice(2).split("--")[1].split(" ")[0]; - const configName = config._attributes.Condition.split("(")[1].split(")")[0]; + const configName = config._attributes!.Condition.split("(")[1].split(")")[0]; return { tscCLIName, diff --git a/packages/tsconfig-reference/scripts/msbuild/generateMarkdown.ts b/packages/tsconfig-reference/scripts/msbuild/generateMarkdown.ts index 00f93c6cff61..74c4f9bdc75a 100644 --- a/packages/tsconfig-reference/scripts/msbuild/generateMarkdown.ts +++ b/packages/tsconfig-reference/scripts/msbuild/generateMarkdown.ts @@ -15,6 +15,7 @@ import matter from "gray-matter"; import prettier from "prettier"; import remark from "remark"; +// @ts-ignore - no types available import remarkHTML from "remark-html"; // @ts-ignore @@ -46,7 +47,7 @@ languages.forEach((lang) => { ); }; - function renderTable(title: string, options: { tscCLIName: string; configName }[]) { + function renderTable(title: string, options: { tscCLIName: string; configName: string }[]) { markdownChunks.push(`

${title}

`); markdownChunks.push(` diff --git a/packages/tsconfig-reference/scripts/schema/downloadSchemaBase.ts b/packages/tsconfig-reference/scripts/schema/downloadSchemaBase.ts index a195f512af10..a3daf6d08895 100644 --- a/packages/tsconfig-reference/scripts/schema/downloadSchemaBase.ts +++ b/packages/tsconfig-reference/scripts/schema/downloadSchemaBase.ts @@ -5,8 +5,8 @@ import { writeFileSync, existsSync, mkdirSync } from "fs"; import { join } from "path"; -const getFileAndStoreLocally = async (url, path, editFunc) => { - const editingFunc = editFunc ? editFunc : (text) => text; +const getFileAndStoreLocally = async (url: string, path: string, editFunc?: (text: string) => string) => { + const editingFunc = editFunc ? editFunc : (text: string) => text; const packageJSON = await fetch(url); const contents = await packageJSON.text(); writeFileSync(new URL(path, import.meta.url), editingFunc(contents), "utf8"); diff --git a/packages/tsconfig-reference/scripts/schema/generateJSON.ts b/packages/tsconfig-reference/scripts/schema/generateJSON.ts index 72319b637464..6500055108f0 100644 --- a/packages/tsconfig-reference/scripts/schema/generateJSON.ts +++ b/packages/tsconfig-reference/scripts/schema/generateJSON.ts @@ -19,9 +19,9 @@ import ts from "typescript"; import type { JSONSchema7 } from "json-schema"; import type { CommandLineOption } from "../tsconfigRules.js"; -const toJSONString = (obj) => +const toJSONString = (obj: any) => prettier.format(JSON.stringify(obj, null, " "), { filepath: "thing.json" }); -const writeJSON = (name, obj) => +const writeJSON = (name: string, obj: any) => writeFileSync(new URL(`result/${name}`, import.meta.url), toJSONString(obj)); export interface CompilerOptionJSON extends CommandLineOptionBase { @@ -40,7 +40,7 @@ const schemaBase = JSON.parse( readFileSync(join("scripts", "schema", "vendor", "base.json"), "utf8") ) as typeof import("./vendor/base.json"); -const tsconfigOpts = JSON.parse(readFileSync(join("data", "tsconfigOpts.json"), "utf8")) as any; +const tsconfigOpts: CompilerOptionJSON[] = JSON.parse(readFileSync(join("data", "tsconfigOpts.json"), "utf8")); // Cut down the list const filteredOptions = tsconfigOpts @@ -70,10 +70,10 @@ filteredOptions.forEach((option) => { if (okToSkip.includes(name)) return; const sectionsPath = new URL(`../../copy/en/options/${name}.md`, import.meta.url); - let section; - if (schemaCompilerOpts[name]) section = schemaCompilerOpts; - if (schemaWatchOpts[name]) section = schemaWatchOpts; - if (schemaBuildOpts[name]) section = schemaBuildOpts; + let section: Record | undefined; + if ((schemaCompilerOpts as Record)[name]) section = schemaCompilerOpts; + if ((schemaWatchOpts as Record)[name]) section = schemaWatchOpts; + if ((schemaBuildOpts as Record)[name]) section = schemaBuildOpts; if (!section) { const title = `Issue creating JSON Schema for tsconfig`; @@ -81,14 +81,14 @@ filteredOptions.forEach((option) => { const msg = `You need to add it to the file: packages/tsconfig-reference/scripts/schema/vendor/base.json - something like: "${name}": { - "description": "${option.description.message}", + "description": "${option.description?.message}", "type": "boolean", "default": false }, You're also probably going to need to make the new Markdown file for the compiler flag, run: -\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something"\\n---\\n${option.description.message}\\n ' > ${fileURLToPath(sectionsPath)}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n +\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something"\\n---\\n${option.description?.message}\\n ' > ${fileURLToPath(sectionsPath)}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n `; throw new Error([title, headline, msg, ""].join("\n\n")); @@ -100,7 +100,7 @@ You're also probably going to need to make the new Markdown file for the compile } catch (error) { // prettier-ignore throw new Error( - `\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something" \\n---\\n${option.description.message.replace(/'/g, "`")}\\n ' > ${fileURLToPath(sectionsPath)}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n` + `\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something" \\n---\\n${option.description?.message.replace(/'/g, "`")}\\n ' > ${fileURLToPath(sectionsPath)}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n` ); } @@ -140,7 +140,7 @@ for (const [properties, options] of [ (option) => option.name === name && option.category?.key !== "Command_line_Options_6171" ); if (!option) { - properties[name] = undefined; + (properties as Record)[name] = undefined; } else if (option.type === "list") { updateItemsSchema( ((optionSchema as Extract).items as never) || [], diff --git a/packages/tsconfig-reference/scripts/schema/result/schema.json b/packages/tsconfig-reference/scripts/schema/result/schema.json index b8b907491d8d..1d19571f4cdf 100644 --- a/packages/tsconfig-reference/scripts/schema/result/schema.json +++ b/packages/tsconfig-reference/scripts/schema/result/schema.json @@ -860,6 +860,7 @@ "esnext.regexp", "esnext.iterator", "esnext.float16", + "esnext.typedarrays", "esnext.error", "esnext.sharedmemory", "decorators", @@ -867,7 +868,7 @@ ] }, { - "pattern": "^(?:[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]2015|[Ee][Ss]7|[Ee][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x][Tt]\\.[Rr][Ee][Gg][Ee][Xx][Pp]|[Ee][Ss][Nn][Ee][Xx][Tt]\\.[Ii][Tt][Ee][Rr][Aa][Tt][Oo][Rr]|[Ee][Ss][Nn][Ee][Xx][Tt]\\.[Ff][Ll][Oo][Aa][Tt]16|[Ee][Ss][Nn][Ee][Xx][Tt]\\.[Tt][Yy][Pp][Ee][Dd][Aa][Rr][Rr][Aa][Yy][Ss]|[Ee][Ss][Nn][Ee][Xx][Tt]\\.[Ee][Rr][Rr][Oo][Rr]|[Ee][Ss][Nn][Ee][Xx][Tt]\\.[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss]|[Dd][Ee][Cc][Oo][Rr][Aa][Tt][Oo][Rr][Ss]\\.[Ll][Ee][Gg][Aa][Cc][Yy])$" } ] }, diff --git a/packages/tsconfig-reference/scripts/tsconfig/generateJSON.ts b/packages/tsconfig-reference/scripts/tsconfig/generateJSON.ts index 397fde24d3d2..6246d9009da1 100644 --- a/packages/tsconfig-reference/scripts/tsconfig/generateJSON.ts +++ b/packages/tsconfig-reference/scripts/tsconfig/generateJSON.ts @@ -27,14 +27,14 @@ import { } from "../tsconfigRules.js"; import { CompilerOptionName } from "../../data/_types"; -const toJSONString = (obj) => +const toJSONString = (obj: any) => prettier.format(JSON.stringify(obj, null, " "), { filepath: "thing.json" }); -const writeJSON = (name, obj) => +const writeJSON = (name: string, obj: any) => writeFileSync( new URL(`../../data/${name}`, import.meta.url), toJSONString(obj) ); -const writeString = (name, text) => +const writeString = (name: string, text: string) => writeFileSync( new URL(`../../data/${name}`, import.meta.url), prettier.format(text, { filepath: name }) @@ -147,7 +147,7 @@ allOptions.forEach((option) => { // Convert JS Map types to a JSONable obj if ("type" in option && typeof option.type === "object" && "get" in option.type) { // Option definitely has a map obj, need to resolve it - const newOptions = {}; + const newOptions: Record = {}; option.type.forEach((v, k) => (newOptions[k] = v)); // @ts-ignore option.type = newOptions; @@ -155,8 +155,8 @@ allOptions.forEach((option) => { // Convert categories to be something which can be looked up if ("category" in option) { - categories.add(option.category); - option.categoryCode = option.category.code; + categories.add(option.category!); + option.categoryCode = option.category!.code; option.category = undefined; } else if (option.name in additionalOptionDescriptors) { // Set category code manually because some options have no category @@ -182,15 +182,15 @@ allOptions.forEach((option) => { } if (name in allowedValues) { - option.allowedValues = allowedValues[name]; + option.allowedValues = (allowedValues as any)[name]; } if (name in configToRelease) { - option.releaseVersion = configToRelease[name]; + option.releaseVersion = (configToRelease as any)[name]; } if (name in defaultsForOptions) { - const defaultValue = defaultsForOptions[name]; + const defaultValue = (defaultsForOptions as any)[name]; option.defaultValue = Array.isArray(defaultValue) ? defaultValue.join(" ") : defaultValue; } @@ -213,7 +213,7 @@ writeString( .join("' | '")}'` ); -const categoryMap = {}; +const categoryMap: Record = {}; categories.forEach((c) => (categoryMap[c.code] = c)); // Add custom categories, for custom compiler flags diff --git a/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts b/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts index 6c338f6f8966..1d47d2645176 100644 --- a/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts +++ b/packages/tsconfig-reference/scripts/tsconfig/generateMarkdown.ts @@ -36,8 +36,8 @@ import { parseMarkdown, } from "../tsconfigRules.js"; -const options = JSON.parse(readFileSync(join("data", "tsconfigOpts.json"), "utf8")); -const categories = JSON.parse(readFileSync(join("data", "tsconfigCategories.json"), "utf8")); +const options: CompilerOptionJSON[] = JSON.parse(readFileSync(join("data", "tsconfigOpts.json"), "utf8")); +const categories: Record = JSON.parse(readFileSync(join("data", "tsconfigCategories.json"), "utf8")); const orderedCategories = [ "Project_Files_0", @@ -130,7 +130,7 @@ languages.forEach((lang) => { ); // Intro to the section - const sectionsPath = getPathInLocale(join("sections", section.name + ".md")); + const sectionsPath = getPathInLocale(join("sections", section.name + ".md"))!; const sectionsFile = matter.read(fileURLToPath(sectionsPath)); mdChunks.push("\n" + sectionsFile.content + "\n"); @@ -138,7 +138,7 @@ languages.forEach((lang) => { if (sectionCategories.length > 1) { mdChunks.push(`