Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uprefactor: use node v12 types, matching WORKSPACE version #17653
Conversation
|
Does the build failure here mean that we'd need to land the new types in both the main repo and this one at the same time? |


The WORKSPACE was updated to use node 12 in #16976 but the type checking was still using the types for node 12. The newer typings are a bit more precise but also bring in a return type overload for
fs.stat(due to{bigint: true}).This updates existing references to node 10 to node 12, moves to the latest typings packages, selects node v12 types, and fixes type errors that arise from those changes.
For the error argument type change in
node/host.tsI went for a union of the previous (wrong) type and the newly fixed type. Technicallyerrcan never be undefined but this way it's still safe to pull this code into contexts that may be using outdated versions of@types/node. A nice future cleanup would be remove the question mark on thoseerr?arguments.