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

Added tests for jsx-curly-spacing that deal with comments in children. #1414

Merged

Conversation

s-h-a-d-o-w
Copy link
Contributor

See also:
#648 (comment)

@oyeanuj
Copy link

oyeanuj commented Nov 4, 2017

@ljharb Does this seem good to merge? I'm also running into this problem.

@ljharb ljharb force-pushed the jsx-curly-spacing-children-tests branch from 8715216 to 36a2008 Compare December 20, 2017 00:42
@ljharb
Copy link
Member

ljharb commented Dec 20, 2017

I've rebased this, and one test is still failing.

@ljharb
Copy link
Member

ljharb commented Dec 20, 2017

Notably, the one failing test is just about failing to remove a space from before a }; no comments are removed.

Before this, spaces before/after braces when there should be none resulted in two overlapping fixes for the full brace content.
And so they required two passes. But the tester does only one pass, so only one white space was fixed and the test failed.

By including comments in the range calculation for the fix, the range is now properly limited, making it possible to have start and end fixes in one pass.
s-h-a-d-o-w added a commit to s-h-a-d-o-w/eslint-plugin-react that referenced this pull request Feb 16, 2018
Before this, spaces before/after braces when there should be none resulted in two overlapping fixes for the full brace content.
And so they required two passes. But the tester does only one pass, so only one white space was fixed and the test failed.

By including comments in the range calculation for the fix, the range is now properly limited, making it possible to have start and end fixes in one pass.
@s-h-a-d-o-w
Copy link
Contributor Author

Sweet, looks like this is good to go (see my commit message for details about what the problem was).

@ljharb ljharb force-pushed the jsx-curly-spacing-children-tests branch from 9219e52 to e4de360 Compare February 19, 2018 22:35
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants