facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.37k stars 953 forks source link

Replace `fs.rmdir` with `fs.rm` #5667

Closed trivikr closed 3 months ago

trivikr commented 3 months ago

Is your request related to a problem? Please describe.

This project uses fs.rmdir with { recursive: true } which has been runtime deprecated since Node.js v16.0.0.

Example code

import fs from "fs-extra";

const dir = "test";
await fs.mkdir(dir);
await fs.rmdir("test", { recursive: true });

Output

(node:93995) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)

Describe the solution you'd like

Replace fs.rmdir with fs.rm API call

Example code which does not thrown runtime warning

import fs from "fs-extra";

const dir = "test";
await fs.mkdir(dir);
await fs.rm("test", { recursive: true });
antonk52 commented 3 months ago

Closed by https://github.com/facebook/flipper/commit/b819119b70a4be4fdbebdb3599d3e5c6f192f225