Skip to content

Conversation

chrisbujok
Copy link
Contributor

@chrisbujok chrisbujok commented Feb 8, 2017

Improves clarity of snapshot diffs by placing closing brackets below the last prop in element.

Note: In case of element without props, closing bracket remains in the same line as opening tag - the same way as default tag-aligned location in ESLint (react/jsx-closing-bracket-location) - recommended in Airbnb React/JSX Style guide, so it will print:

<Foo />

instead of:

<Foo
/>

I have no strong opinion whether it should remain in the same line or go to next line in the same way as with multiline elements, so please let me know if I should change that.

Fixes #2830.

@cpojer cpojer merged commit 204e46c into jestjs:master Feb 8, 2017
@cpojer
Copy link
Member

cpojer commented Feb 8, 2017

Nice work! Thanks for sending a PR to Jest to help make testing better for everyone :)

@chrisbujok chrisbujok deleted the snapshot-closing-bracket-new-line branch February 8, 2017 10:45
skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closing bracket for JSX elements after new line in snapshots
3 participants