saveToDisk = (process) => (text, file) => {
  if (!file.startsWith(NODE_MODULES_DIRECTORY)) {
    return text;
  }

  const code = process(text);

  writeFile(
    path.join(
      PROJECT_ROOT,
      ".tmp/@typescript-eslint-esm/",
      path.relative(NODE_MODULES_DIRECTORY, file),
    ),
    code,
  );

  return code;
}
```js
  var FOO;
  (function (FOO) {
  })(FOO || (exports.FOO = FOO = {}));
  ```
  ->
  ```js
  var FOO;
  (function (FOO) {
  })(FOO ?? {}));
  export {FOO};
  ```