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 "allowMultiline" being undefined in some cases #1179

Merged
merged 1 commit into from May 7, 2017

Conversation

fatfisz
Copy link
Contributor

@fatfisz fatfisz commented May 7, 2017

From comment #857 (comment):

Btw. I think there was a small bug: when only "spacing" was set in the extended options, the following line was setting "allowMultiline" to undefined:

var multiline = context.options[1] ? context.options[1].allowMultiline : true;

Then in all the following conditions !multiline was being checked, which yielded a different result than the > default true value would.

Now I'll be checking if the property exists on the config object (using the has package, I found it being used in other rules).

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.

Thanks, this looks great.

@ljharb ljharb added the bug label May 7, 2017
@ljharb ljharb merged commit 688a78f into jsx-eslint:master May 7, 2017
@fatfisz fatfisz deleted the fix-undefined-allow-multiline branch May 7, 2017 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants