Skip to content

Commit

Permalink
fix: use double-equal instead of triple for conditional comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
alharris-at committed Nov 23, 2021
1 parent e83c4f0 commit ff57822
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1643,15 +1643,15 @@ export default function CustomButton(
<Button
labelWidth={width}
disabled={
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn === true ? true : false
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn == true ? true : false
}
prompt={
buttonUser?.age && buttonUser?.age > 18
? \`\${buttonUser?.firstname}\${\\", cast your vote.\\"}\`
: \\"Sorry you cannot vote\\"
}
backgroundColor={
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn === true
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn == true
? buttonUser?.loggedInColor
: buttonUser?.loggedOutColor
}
Expand Down Expand Up @@ -1696,20 +1696,20 @@ export default function ConditionalComponentWithDataBinding(
<Flex {...rest} {...getOverrideProps(overrides, \\"Flex\\")}>
<Text
value={
student?.id && student?.id === \\"idstringuserinput\\"
student?.id && student?.id == \\"idstringuserinput\\"
? student?.createdAt
: student?.id
}
children={
student?.id && student?.id === \\"idstringuserinput\\"
student?.id && student?.id == \\"idstringuserinput\\"
? student?.createdAt
: student?.id
}
{...getOverrideProps(overrides, \\"Flex.Text[0]\\")}
></Text>
<Button
value={
student?.id && student?.id === \\"idstringuserinput\\"
student?.id && student?.id == \\"idstringuserinput\\"
? student?.createdAt
: student?.id
}
Expand Down Expand Up @@ -1742,7 +1742,7 @@ export default function CustomButton(
return (
/* @ts-ignore: TS2322 */
<Button
disabled={buttonColor && buttonColor === \\"red\\" ? true : false}
disabled={buttonColor && buttonColor == \\"red\\" ? true : false}
{...rest}
{...getOverrideProps(overrides, \\"Button\\")}
></Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ export function resolvePropToExpression(prop: ComponentPropertyValueTypes): Expr
export function getSyntaxKindToken(operator: string): BinaryOperatorToken | undefined {
switch (operator) {
case 'eq':
return factory.createToken(SyntaxKind.EqualsEqualsEqualsToken);
return factory.createToken(SyntaxKind.EqualsEqualsToken);
case 'ne':
return factory.createToken(SyntaxKind.ExclamationEqualsEqualsToken);
return factory.createToken(SyntaxKind.ExclamationEqualsToken);
case 'le':
return factory.createToken(SyntaxKind.LessThanEqualsToken);
case 'lt':
Expand Down

0 comments on commit ff57822

Please sign in to comment.