Files
test-repo/changelog_unreleased/api/16857.md
T
SUZUKI Sosuke a3ba537295 Fix loading ESM-style shared config file in Node.js 23 (#16857)
* Return `.default` when Node.js 23 module feature is enabled

* Add changelog

* Add `ERR_REQUIRE_ASYNC_MODULE` to ignored error code
2024-11-25 21:33:48 +09:00

787 B

Fix loading ESM-style shared config file in Node.js 23 (#16857 by @sosukesuzuki)

In Prettier 3.3, attempting to load an ESM-style shared config file in Node.js 23 resulted in the following warnings, preventing the options from being loaded:

[warn] Ignored unknown option { __esModule: true }.
[warn] Ignored unknown option { default: { trailingComma: "es5", tabWidth: 4, singleQuote: true } }.

This issue was caused by a new module feature in Node.js 23, known as require(ESM). Prettier 3.4 resolves this problem, allowing the options to load correctly.

For more details, please see https://github.com/prettier/prettier/issues/16812.