Created
November 13, 2023 07:39
-
-
Save Jack-Works/404ea508a87765e61be1dbf0f2fe0613 to your computer and use it in GitHub Desktop.
prettier 3.1 feedback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// Case 1 | |
// before | |
len = len > 32 ? (len > 48 ? 66 : 48) : 32 | |
// after | |
len = | |
len > 32 ? | |
len > 48 ? | |
66 | |
: 48 | |
: 32 | |
// expected | |
len = | |
len > 32 ? | |
len > 48 ? 66 : 48 | |
: 32 | |
//// Case 2 | |
// before | |
'__REACT_DEVTOOLS_GLOBAL_HOOK__' in globalThis || | |
isBeta || | |
isTest || | |
!isEnvironment(Environment.HasBrowserAPI) | |
? 'open' | |
: 'closed' | |
// after | |
( | |
'__REACT_DEVTOOLS_GLOBAL_HOOK__' in globalThis || | |
isBeta || | |
isTest || | |
!isEnvironment(Environment.HasBrowserAPI) | |
) ? | |
'open' | |
: 'closed' | |
// expected | |
'__REACT_DEVTOOLS_GLOBAL_HOOK__' in globalThis || | |
isBeta || | |
isTest || | |
!isEnvironment(Environment.HasBrowserAPI) ? | |
'open' | |
: 'closed' | |
//// Case 3 | |
// before | |
const bg = supportColor | |
? null | |
: { | |
backgroundImage: `url(${selected.u()})`, | |
backgroundSize: 'contain', | |
} | |
// after | |
const bg = | |
supportColor ? null : ( | |
{ | |
backgroundImage: `url(${selected.u()})`, | |
backgroundSize: 'contain', | |
} | |
) | |
// expected | |
const bg = supportColor ? null : { | |
backgroundImage: `url(${selected.u()})`, | |
backgroundSize: 'contain', | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// before | |
{borderless ? ( | |
children | |
) : ( | |
<div | |
className={classNames('border rounded-lg border-line-light dark:border-neutral-800', { | |
'overflow-hidden': clipEdge, | |
})}> | |
{children} | |
</div> | |
)} | |
// after, I like no `()`s, but I think it can also be ported to prettier without flags now. | |
{borderless ? | |
children | |
: <div | |
className={classNames('border rounded-lg border-line-light dark:border-neutral-800', { | |
'overflow-hidden': clipEdge, | |
})}> | |
{children} | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment