Skip to content

Type process.env and fs.rm options with undefined, as @types/node does - #60193

Merged
meta-codesync[bot] merged 1 commit into
mainfrom
export-D133561233
Nov 21, 2026
Merged

meta-codesync[bot] merged 1 commit into
mainfrom
export-D133561233

Conversation

@SamChou19815

Copy link
Copy Markdown
Member

Summary:
X-link: react/metro#2261

The Node library definitions typed process.env values as string | void, and the optional RmOptions fields as T | void. types/node uses undefined in both places:

env: {[key: string]: string | undefined, ...};
force?: boolean | undefined,

Library definitions accept undefined without any .flowconfig option, and Flow treats it the same as void, so this changes nothing for code that checks against these definitions today. It matters for projects that give void TypeScript's meaning, where undefined is the type of a missing value and void is not.

Metro's copy of these definitions gets the same change, so the two stay identical.

Changelog: [Internal]

Differential Revision: D133561233

…ode` does

Summary:
X-link: react/metro#2261

The Node library definitions typed `process.env` values as `string | void`, and the optional `RmOptions` fields as `T | void`. `types/node` uses `undefined` in both places:

```
env: {[key: string]: string | undefined, ...};
force?: boolean | undefined,
```

Library definitions accept `undefined` without any `.flowconfig` option, and Flow treats it the same as `void`, so this changes nothing for code that checks against these definitions today. It matters for projects that give `void` TypeScript's meaning, where `undefined` is the type of a missing value and `void` is not.

Metro's copy of these definitions gets the same change, so the two stay identical.

Changelog: [Internal]

Differential Revision: D133561233
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 20, 2026
@meta-codesync

meta-codesync Bot commented Nov 20, 2026

Copy link
Copy Markdown

@SamChou19815 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133561233.

@meta-codesync
meta-codesync Bot merged commit 32a5aa6 into main Nov 21, 2026
109 of 110 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @SamChou19815 in 32a5aa6

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 21, 2026
@SamChou19815
SamChou19815 deleted the export-D133561233 branch November 21, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants