mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
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:
1 parent
d3f45bfe49
commit
1675c56e59
165 files changed
+853
-1141
No files matched your search
@@ -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 (
|
||||
|
||||
Reference in new issue
Block a user