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 css embed in JSX when using (only) a spread attribute #15896

Merged
merged 6 commits into from Jan 14, 2024
Merged

Fix css embed in JSX when using (only) a spread attribute #15896

merged 6 commits into from Jan 14, 2024

Conversation

eelco
Copy link
Contributor

@eelco eelco commented Jan 8, 2024

Description

Prettier crashes on this JSX/TSX code:

<style {...spread}>{`.{}`}</style>

This is fixed by improving the detection mechanism used in isStyledJsx.

Checklist

  • I’ve added tests to confirm my change works.
  • 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

src/language-js/embed/css.js Outdated Show resolved Hide resolved
src/language-js/embed/css.js Outdated Show resolved Hide resolved
@eelco eelco requested a review from fisker January 9, 2024 07:28
Copy link
Sponsor Member

@fisker fisker left a comment

Choose a reason for hiding this comment

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

Thank you!

@sosukesuzuki sosukesuzuki merged commit 0bfcb2d into prettier:main Jan 14, 2024
28 checks passed
@eelco eelco deleted the fix/css-embed branch January 15, 2024 18:25
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.

None yet

3 participants