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: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) #12616

Merged
merged 5 commits into from Nov 30, 2019

Conversation

mysticatea
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Bug fix: #12614

What changes did you make? (Give an overview)

This PR changes isSpaceBetweenTokens() method to recognize spaces in JSXText tokens in order to fix #12614. The JSXText tokens include whitespaces such as indentation.

Is there anything you'd like reviewers to focus on?

  • Is this direction right?

@mysticatea mysticatea added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion patch candidate This issue may necessitate a patch release in the next few days labels Nov 28, 2019
lib/source-code/source-code.js Outdated Show resolved Hide resolved
tests/lib/source-code/source-code.js Outdated Show resolved Hide resolved
@ljharb
Copy link
Sponsor Contributor

ljharb commented Nov 29, 2019

It'd be great if you had the time to verify that eslint-plugin-react's tests pass on master with this change :-)

@mysticatea
Copy link
Member Author

I'm sorry, today I failed to get time to follow the review. I will do it tomorrow (JST).

It'd be great if you had the time to verify that eslint-plugin-react's tests pass on master with this change :-)

I confirmed it by copying/pasting this patch to node_modules/eslint and running tests.

@mysticatea mysticatea changed the title Fix: isSpaceBetween should recognize the spaces in JSXText (fixes #12614) Fix: isSpaceBetween() recognizes spaces in JSXText (fixes #12614) Nov 30, 2019
@mysticatea mysticatea changed the title Fix: isSpaceBetween() recognizes spaces in JSXText (fixes #12614) Fix: isSpaceBetweenTokens() recognizes spaces in JSXText (fixes #12614) Nov 30, 2019
@mysticatea
Copy link
Member Author

I have updated this PR. Now, this patch doesn't apply to the new isSpaceBetween() method.

Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Nov 30, 2019
@kaicataldo kaicataldo merged commit bc435a9 into master Nov 30, 2019
@kaicataldo kaicataldo deleted the issue12614 branch November 30, 2019 16:43
ljharb added a commit to ljharb/eslint-plugin-react that referenced this pull request Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features patch candidate This issue may necessitate a patch release in the next few days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v6.7.0 broke autofixing for eslint-plugin-react
3 participants