mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org> Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
475 B
475 B
JSON File Writing Must Be Atomic
- You MUST use
safeWriteJson(filePath: string, data: any): Promise<void>fromsrc/utils/safeWriteJson.tsinstead ofJSON.stringifywith file-write operations safeWriteJsonwill create parent directories if necessary, so do not callmkdirprior tosafeWriteJsonsafeWriteJsonprevents data corruption via atomic writes with locking and streams the write to minimize memory footprint- Test files are exempt from this rule