Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/poor-bears-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@typescript/vfs": patch
---

Update for compatibility with TypeScript 6.0.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.20260213",
"tslib": "^2.6.2",
"prettier": "^2.0.2",
"sharp": "0.28.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/ata/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"target": "ES2015",
"declaration": false,
"noEmit": true
}
}
}
2 changes: 1 addition & 1 deletion packages/glossary/scripts/generateMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion packages/glossary/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"resolveJsonModule": true,
"allowJs": true
"allowJs": true,
"types": ["*"]
}
}
4 changes: 2 additions & 2 deletions packages/playground-worker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"target": "ES2020",
"allowJs": false,
"module": "esnext",
"moduleResolution": "node"
"moduleResolution": "bundler"
}
}
}
1 change: 1 addition & 0 deletions packages/playground/src/createConfigDropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const createSelect = (title: string, id: string, blurb: string, sandbox: Sandbox
.forEach(key => {
// hide Latest
if (key === "Latest") return
if (key === "LatestStandard") return

const option = document.createElement("option")
option.value = key
Expand Down
1 change: 1 addition & 0 deletions packages/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"include": ["src"],
"compilerOptions": {
"ignoreDeprecations": "6.0",
"outDir": "../typescriptlang-org/static/js/playground",
"jsx": "react",
"target": "ES2016",
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -14,6 +15,7 @@
"allowJs": true,
"moduleResolution": "node",
"esModuleInterop": true,
"skipLibCheck": true
"skipLibCheck": true,
"types": ["*"]
}
}
2 changes: 1 addition & 1 deletion packages/ts-twoslasher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/prettier": "^1.19.0",
"@types/prettier": "^2.7.3",
"dts-cli": "^2.0.5",
"jest": "^29.5.0",
"jest-file-snapshot": "^0.3.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

Got TS2015 for target but it is not a supported value by the TS compiler.

Allowed values: es3,es5,es6,es2015,es2016,es2017,es2018,es2019,es2020,es2021,es2022,es2023,es2024,esnext
Allowed values: es3,es5,es6,es2015,es2016,es2017,es2018,es2019,es2020,es2021,es2022,es2023,es2024,es2025,esnext
8 changes: 4 additions & 4 deletions packages/ts-twoslasher/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"baseUrl": "./src",
"moduleResolution": "bundler",
"paths": {
"*": ["src/*", "node_modules/*"]
"*": ["./src/*"]
},
"jsx": "react",
"esModuleInterop": true
"esModuleInterop": true,
"types": ["*"]
}
}
1 change: 1 addition & 0 deletions packages/tsconfig-reference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@types/json-schema": "^7.0.15",
"ts-node": "*",
"typescript": "*",
"typescript-for-docs": "npm:typescript@5.9.3",
"xml-js": "^1.6.11"
},
"type": "module"
Expand Down
18 changes: 9 additions & 9 deletions packages/tsconfig-reference/scripts/cli/generateJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
console.log("TSConfig Ref: JSON for CLI Opts");

import ts from "typescript";
import ts from "typescript-for-docs";

import { CommandLineOptionBase } from "../types";
import { writeFileSync, readFileSync } from "fs";
Expand All @@ -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 })
Expand All @@ -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
Expand Down Expand Up @@ -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<string, any> = {};
option.type.forEach((v, k) => (newOptions[k] = v));
// @ts-ignore
option.type = newOptions;
Expand All @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/tsconfig-reference/scripts/cli/generateMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, CompilerOptionJSON[]> = JSON.parse(readFileSync(join("data", "cliOpts.json"), "utf8"));

const knownTypes: Record<string, string> = {};

Expand Down Expand Up @@ -107,14 +107,14 @@ languages.forEach((lang) => {
markdownChunks.push(` <td>${parseMarkdown(optType)}</td>`);

if (!opts?.noDefaults) {
markdownChunks.push(` <td>${parseMarkdown(option.defaultValue)}</td>`);
markdownChunks.push(` <td>${parseMarkdown(option.defaultValue ?? "")}</td>`);
}
markdownChunks.push(`</tr>`);

// 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(`<tr class="option-description ${oddEvenClass}"><td colspan="3">`);
markdownChunks.push(`${parseMarkdown(description)}`.trim());
markdownChunks.push(`${parseMarkdown(description ?? "")}`.trim());
markdownChunks.push(`</td></tr>\n`);
});
markdownChunks.push(`</tbody></table>\n`);
Expand Down
8 changes: 4 additions & 4 deletions packages/tsconfig-reference/scripts/msbuild/generateJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Comment on lines +18 to 19
Copy link
Member

@DanielRosenwasser DanielRosenwasser Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it has types - I'm guessing you don't want to upgrade though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are like 100000 versions behind, it's not worth it


// @ts-ignore
Expand Down Expand Up @@ -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(`<h3>${title}</h3>`);

markdownChunks.push(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
24 changes: 12 additions & 12 deletions packages/tsconfig-reference/scripts/schema/generateJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import { join } from "path";
import { fileURLToPath } from "url";
import prettier from "prettier";
import { CompilerOptionName } from "../../data/_types";
import ts from "typescript";
import ts from "typescript-for-docs";
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 {
Expand All @@ -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
Expand Down Expand Up @@ -70,25 +70,25 @@ 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<string, any> | undefined;
if ((schemaCompilerOpts as Record<string, any>)[name]) section = schemaCompilerOpts;
if ((schemaWatchOpts as Record<string, any>)[name]) section = schemaWatchOpts;
if ((schemaBuildOpts as Record<string, any>)[name]) section = schemaBuildOpts;

if (!section) {
const title = `Issue creating JSON Schema for tsconfig`;
const headline = `Could not find '${name}' in schemaBase.definitions - it needs to either be in compilerOptions / watchOptions / buildOptions`;
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"));
Expand All @@ -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`
);
}

Expand Down Expand Up @@ -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<string, any>)[name] = undefined;
} else if (option.type === "list") {
updateItemsSchema(
((optionSchema as Extract<typeof optionSchema, { items?: unknown }>).items as never) || [],
Expand Down
Loading