Fix loading ESM-style shared config file in Node.js 23#16857
Merged
sosukesuzuki merged 3 commits intoprettier:mainfrom Nov 25, 2024
Merged
Fix loading ESM-style shared config file in Node.js 23#16857sosukesuzuki merged 3 commits intoprettier:mainfrom
sosukesuzuki merged 3 commits intoprettier:mainfrom
Conversation
Member
|
Have you tried esm module with TLA? It should broken too. |
fisker
reviewed
Nov 24, 2024
| return required.default; | ||
| } | ||
| return required; | ||
| } catch (/** @type {any} */ error) { |
Member
There was a problem hiding this comment.
Maybe simply use required?.default ?? required? babel/babel#16441
Contributor
Author
There was a problem hiding this comment.
I prefer the current code. Because if the option had a default field, it would be used. I know that such a case rarely happens, but it's not that complicated code, so I prefer to be conservative.
Contributor
Author
Thanks, 3244020 addresses the case. |
fisker
approved these changes
Nov 25, 2024
fisker
added a commit
to fisker/prettier
that referenced
this pull request
Dec 16, 2024
sosukesuzuki
pushed a commit
that referenced
this pull request
Dec 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #16812
I don't add tests for this change due to jestjs/jest#15363, but I was able to test it locally.
Checklist
docs/directory).changelog_unreleased/*/XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨