Skip to content

Update: utils.getTestInfo filter elements equal to null (fixes #37). #38

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

Merged
merged 2 commits into from
Sep 7, 2017

Conversation

aladdin-add
Copy link
Contributor

No description provided.

lib/utils.js Outdated
@@ -179,8 +179,8 @@ module.exports = {
const invalidProperty = run.properties.find(prop => module.exports.getKeyName(prop) === 'invalid');

return {
valid: validProperty && validProperty.value.type === 'ArrayExpression' ? validProperty.value.elements : null,
invalid: invalidProperty && invalidProperty.value.type === 'ArrayExpression' ? invalidProperty.value.elements : null,
valid: validProperty && validProperty.value.type === 'ArrayExpression' ? validProperty.value.elements.filter(Boolean) : null,
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‘m considering changing the null to [] -- this can also avoid some null check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

Copy link
Contributor

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Can you add tests for this here?

Also, I think there are some null checks in rules that can now be removed.

@aladdin-add
Copy link
Contributor Author

ping @not-an-aardvark

Copy link
Contributor

@not-an-aardvark not-an-aardvark 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!

@not-an-aardvark not-an-aardvark merged commit 7b33446 into eslint-community:master Sep 7, 2017
@aladdin-add aladdin-add deleted the issue37 branch September 8, 2017 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants