Bump TypeScript module output options target
and lib
to ES2022
#4507
Open
Description
opened on Jul 7, 2024
Motivation
- Upgrade to TypeScript v5.0 and set
module{,Resolution}
option toNode16
#3645 sets themoduleResolution
option tonode16
, which implies a target ofES2022
.
Features
ES2022
Top-level-> not available to CJS modulesawait
expressions- Important, because with
moduleResolution
set tonode16
, we can only reference ESM-only modules using dynamic import syntax, which becomes much easier to write with top-levelawait
.
- Important, because with
ES2021
String.prototype.replaceAll()
Promise.any()
Regressions
- The
ErrorOptions
type defined in@metamask/approval-controller
needs to be renamed, as it shadows a new global variable defined in theES2022.Error
library.- Other exports from the package may also need to be renamed to present a consistent naming scheme.
- See https://github.com/MetaMask/core/actions/runs/9830120317/job/27135954759
Activity