Upgrade and simplify root tsconfig for Node.js 22#4072
Open
ddbeck wants to merge 1 commit into
Open
Conversation
ddbeck
commented
May 26, 2026
Collaborator
Author
ddbeck
left a comment
There was a problem hiding this comment.
My guided tour for the actual reviewer.
Comment on lines
-1
to
+11
| import { DefinedError } from "ajv"; | ||
| import type { DefinedError } from "ajv"; | ||
| import stringify from "fast-json-stable-stringify"; | ||
| import { fdir } from "fdir"; | ||
| import { execSync } from "node:child_process"; | ||
| import fs from "node:fs"; | ||
| import path from "node:path"; | ||
| import winston from "winston"; | ||
| import yargs from "yargs"; | ||
| import * as data from "../index.js"; | ||
| import { validate, validateProposed } from "./validate.js"; | ||
| import { fdir } from "fdir"; | ||
| import YAML from "yaml"; | ||
| import yargs from "yargs"; | ||
| import * as data from "../index.ts"; | ||
| import { validate, validateProposed } from "./validate.ts"; |
Collaborator
Author
There was a problem hiding this comment.
My editor sorted these imports. Let me know if you want me to revert this.
Comment on lines
18
to
+101
| @@ -94,7 +98,7 @@ function getNotes(compatKey: string): Map<string, string[]> { | |||
| const f = feature(compatKey); | |||
| for (const browserKey of coreBrowserSet) { | |||
| const statements = f | |||
| .supportStatements(defaultCompat.browser(browserKey)) | |||
| .supportStatements(compat.browser(browserKey)) | |||
Collaborator
Author
There was a problem hiding this comment.
The package doesn't actually export defaultCompat, which makes the type checker mad. These two change fix that problem.
| "strict": false | ||
| }, | ||
| "exclude": ["packages/", "gh-pages/"] | ||
| "exclude": ["packages/"] |
Collaborator
Author
There was a problem hiding this comment.
gh-pages/ doesn't exist anymore.
Comment on lines
+2
to
+5
| "extends": [ | ||
| "@tsconfig/node22/tsconfig.json", | ||
| "@tsconfig/node-ts/tsconfig.json" | ||
| ], |
Collaborator
Author
There was a problem hiding this comment.
This is the big difference. We only set the options specific to this project (e.g., noEmit), then accept recommended defaults for our runtime.
foolip
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This turns on some JavaScript language features and cleans up some longstanding quirks in our TypeScript config.
Background
When we upgraded to Node.js 22, we didn't change the TypeScript config, so the type checker won't actually let you use any of the new JavaScript niceties in this version of Node.
On top of that, our root
tsconfig.jsonfile is a little unconventional (there are other PRs and issues open about this, though this PR doesn't address all of it).What's new here
This PR does a few little things:
tsconfig.jsonfile. Then, as a consequence, the three following things..tsimport extensions, exclusively, in our project scripts.typeimports, where applicable. This is more explicit and will help us drop a dependency in the future.Finally, this only touches the root
tsconfig.json. There is some related work to do in thepackages/directories, but to make this PR easier to review, I elected to do those in follow up PRs.Related PRs