Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Fixes shopify/jest/no-if to now ignore if statements inside block statements #299

Merged
merged 6 commits into from
Jun 17, 2019

Conversation

cartogram
Copy link
Contributor

Closes #263

@cartogram cartogram requested a review from lemonmade June 10, 2019 17:56
Copy link
Member

@lemonmade lemonmade left a comment

Choose a reason for hiding this comment

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

lol my other review looks really dumb now

lib/rules/jest/no-if.js Outdated Show resolved Hide resolved
@cartogram cartogram changed the base branch from no-if-ternary to master June 10, 2019 22:08
@cartogram cartogram force-pushed the no-if-nested-blocks branch 3 times, most recently from 792ce70 to ddef4c8 Compare June 12, 2019 03:43
lib/rules/jest/no-if.js Show resolved Hide resolved
lib/rules/jest/no-if.js Outdated Show resolved Hide resolved
lib/rules/jest/no-if.js Outdated Show resolved Hide resolved
@cartogram
Copy link
Contributor Author

@lemonmade ready for another look

'each fork in the conditional statement.',
'If your conditionals are required to',
'satisfy the typescript type checker, consider',
'using a non-null assertion operator (!) instead.',
Copy link
Member

Choose a reason for hiding this comment

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

❤️

return;
}

if (isTestDefinition(lastCallExpression)) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to compute this manually every time? Can the stack just have the results of calling this?

@cartogram cartogram merged commit aa6bf3f into master Jun 17, 2019
@cartogram cartogram deleted the no-if-nested-blocks branch June 17, 2019 18:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jest/no-if should not complain when not directly nested in it
2 participants