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 alignment bug in jsx-indent (and extract duplicate code) #1539

Merged
merged 4 commits into from
Nov 18, 2017

Conversation

jseminck
Copy link
Contributor

@jseminck jseminck commented Nov 16, 2017

Fixed this bug in the jsx-indent rule: Fixes #1246

Along the way, discovered that a very similar function was defined 3 different times with 3 different implementations in 3 different rules. Using a more advanced version of this function fixed the bug, and then decided to use the same function in all three rules thanks to the new astUtil helper file that we have.

*
* @param {ASTNode} ASTnode The AST node being checked
*/
function findReturnStatement(node) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I re-ordered the functions alphabetically.

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.

Seems legit, thanks

@ljharb ljharb merged commit 771f534 into jsx-eslint:master Nov 18, 2017
@jseminck jseminck deleted the jsx-indent-bug branch November 19, 2017 07:52
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.

Alignment bug?
2 participants