chore: Turn on @typescript-eslint/strict-boolean-expressions

- Fix some bugs about bad conditions

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-06-01 09:27:44 -04:00
1 parent d3f45bfe49
commit 1675c56e59
165 files changed
+853 -1141

No files matched your search

+10 -8
View File
@@ -199,7 +199,8 @@ const RawIcon = (props: IconProps & Dependencies) => {
logger,
...elemProps
} = props;
const isInteractive = interactive ?? !!(onClick || href || link);
const isInteractive =
interactive ?? !!(onClick || href || link !== undefined);
const boundOnClick = (event: React.MouseEvent) => {
if (!disabled) {
@@ -235,16 +236,17 @@ const RawIcon = (props: IconProps & Dependencies) => {
active,
focusable,
},
!size ? { smallest, small, big } : {}
size === undefined ? { smallest, small, big } : {}
),
onClick: isInteractive ? boundOnClick : undefined,
onKeyDown: isInteractive ? boundOnKeyDown : undefined,
tabIndex: isInteractive && focusable && !disabled ? 0 : undefined,
style: size
? ({
"--size": `${size}${isNumber(size) ? "px" : ""}`,
} as React.CSSProperties)
: undefined,
style:
size !== undefined
? ({
"--size": `${size}${isNumber(size) ? "px" : ""}`,
} as React.CSSProperties)
: undefined,
...elemProps,
};
@@ -279,7 +281,7 @@ const RawIcon = (props: IconProps & Dependencies) => {
);
// render icon type
if (link) {
if (link !== undefined) {
const { className, children } = iconProps;
return (