Skip to content
Merged
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
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2020"],
"module": "CommonJS",
"moduleResolution": "node",
"lib": ["ES2023"],
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 can use a ECMAScript version here that's newer than the target, in which case TypeScript will transpile newer features if necessary.

"module": "Node16",
"moduleResolution": "Node16",
Comment on lines +7 to +8
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting these to Node16 is recommended by the TypeScript team, and also speeds up ts-bridge.

"noEmit": true,
"noErrorTruncation": true,
"noUncheckedIndexedAccess": true,
"strict": true,
"target": "es2020"
"target": "ES2020"
Copy link

Choose a reason for hiding this comment

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

Bug: TypeScript Mismatch with Runtime Environment

The lib compiler option is set to ES2023, exposing types for ES2023 APIs (e.g., Array.prototype.findLast, toSorted). However, the project's target environments only guarantee ES2022 support, and TypeScript (with target: ES2020) does not polyfill new runtime APIs. This mismatch allows code using ES2023 features to type-check successfully but fail at runtime. To resolve, align lib with the actual runtime support (e.g., ES2022) or provide necessary polyfills.

Fix in Cursor Fix in Web

},
"exclude": ["./dist", "**/node_modules"]
}
Loading