Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting error on member chain #15915

Merged
merged 6 commits into from Jan 12, 2024
Merged

Conversation

sosukesuzuki
Copy link
Member

Description

Fixes #15912

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@sosukesuzuki
Copy link
Member Author

Maybe this is caused by #15806

Comment on lines 408 to 417
// @ts-expect-error
if (node.object == null) {
// @ts-expect-error
node.object = node.expression.object;
}
// @ts-expect-error
if (node.property == null) {
// @ts-expect-error
node.property = node.expression.property;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fisker This isn't a good. I'm merging this PR as a temporary solution, but do you have any better solution?

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is wrong, should update logic where it's accessing the object/property.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may also cause computed/shorthand check part result wrong..

@sosukesuzuki sosukesuzuki merged commit 7e862bb into prettier:main Jan 12, 2024
28 checks passed
@sosukesuzuki sosukesuzuki deleted the fix-15912 branch January 13, 2024 07:57
medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read properties of undefined (reading 'type')
2 participants