Skip to content

Commit ff57822

Browse files
committed
fix: use double-equal instead of triple for conditional comparisons
1 parent e83c4f0 commit ff57822

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,15 +1643,15 @@ export default function CustomButton(
16431643
<Button
16441644
labelWidth={width}
16451645
disabled={
1646-
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn === true ? true : false
1646+
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn == true ? true : false
16471647
}
16481648
prompt={
16491649
buttonUser?.age && buttonUser?.age > 18
16501650
? \`\${buttonUser?.firstname}\${\\", cast your vote.\\"}\`
16511651
: \\"Sorry you cannot vote\\"
16521652
}
16531653
backgroundColor={
1654-
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn === true
1654+
buttonUser?.isLoggedIn && buttonUser?.isLoggedIn == true
16551655
? buttonUser?.loggedInColor
16561656
: buttonUser?.loggedOutColor
16571657
}
@@ -1696,20 +1696,20 @@ export default function ConditionalComponentWithDataBinding(
16961696
<Flex {...rest} {...getOverrideProps(overrides, \\"Flex\\")}>
16971697
<Text
16981698
value={
1699-
student?.id && student?.id === \\"idstringuserinput\\"
1699+
student?.id && student?.id == \\"idstringuserinput\\"
17001700
? student?.createdAt
17011701
: student?.id
17021702
}
17031703
children={
1704-
student?.id && student?.id === \\"idstringuserinput\\"
1704+
student?.id && student?.id == \\"idstringuserinput\\"
17051705
? student?.createdAt
17061706
: student?.id
17071707
}
17081708
{...getOverrideProps(overrides, \\"Flex.Text[0]\\")}
17091709
></Text>
17101710
<Button
17111711
value={
1712-
student?.id && student?.id === \\"idstringuserinput\\"
1712+
student?.id && student?.id == \\"idstringuserinput\\"
17131713
? student?.createdAt
17141714
: student?.id
17151715
}
@@ -1742,7 +1742,7 @@ export default function CustomButton(
17421742
return (
17431743
/* @ts-ignore: TS2322 */
17441744
<Button
1745-
disabled={buttonColor && buttonColor === \\"red\\" ? true : false}
1745+
disabled={buttonColor && buttonColor == \\"red\\" ? true : false}
17461746
{...rest}
17471747
{...getOverrideProps(overrides, \\"Button\\")}
17481748
></Button>

packages/codegen-ui-react/lib/react-component-render-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ export function resolvePropToExpression(prop: ComponentPropertyValueTypes): Expr
299299
export function getSyntaxKindToken(operator: string): BinaryOperatorToken | undefined {
300300
switch (operator) {
301301
case 'eq':
302-
return factory.createToken(SyntaxKind.EqualsEqualsEqualsToken);
302+
return factory.createToken(SyntaxKind.EqualsEqualsToken);
303303
case 'ne':
304-
return factory.createToken(SyntaxKind.ExclamationEqualsEqualsToken);
304+
return factory.createToken(SyntaxKind.ExclamationEqualsToken);
305305
case 'le':
306306
return factory.createToken(SyntaxKind.LessThanEqualsToken);
307307
case 'lt':

0 commit comments

Comments
 (0)