Skip to content

Commit efa7fb1

Browse files
author
Kubit
committed
Fix typescript and eslint errors
1 parent 53c59ea commit efa7fb1

File tree

12 files changed

+17
-50
lines changed

12 files changed

+17
-50
lines changed

src/components/carousel/hooks/useCarousel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export const useCarousel = ({
401401
carouselContent.style.left = `${left}px`;
402402
}
403403
} else {
404-
let modifyExtraPadding = circular ? extraPadding ?? 0 : 0;
404+
let modifyExtraPadding = circular ? (extraPadding ?? 0) : 0;
405405
if (!circular && extraPadding && index.current === numPagesState - 1) {
406406
modifyExtraPadding = extraPadding * 2;
407407
}

src/components/footer/components/footerContent.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/components/mediaButton/mediaButtonStandAlone.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const MediaButtonStandaloneComponent = (
3333
} = props.twistedIcon ?? {};
3434

3535
const ariaLabel = props.twisted
36-
? twistedIconAriaLabel ?? twistedIconAltText
37-
: iconAriaLabel ?? iconAltText;
36+
? (twistedIconAriaLabel ?? twistedIconAltText)
37+
: (iconAriaLabel ?? iconAltText);
3838

3939
// When 'twisted' changes, We turn around the icon combined with the css property backface-visibility=hidden in the file icon.styled.ts
4040
const iconTwistAnimationTransformValue = props.twisted

src/components/navigationCard/navigationCardStandAlone.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const NavigationCardStandaloneComponent = (
3535
return (
3636
// Can not be spread -> styled component breaks
3737
<NavigationCardStyled
38-
ref={ref as React.ForwardedRef<HTMLButtonElement>}
38+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
39+
ref={ref as any}
3940
aria-disabled={props['aria-disabled']}
4041
as={props.url ? props.component : 'button'}
4142
className={props.className}

src/components/option/optionStandAlone.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const OptionStandAlone = React.forwardRef(
5959
{...ariaProps}
6060
$stateStyles={stateStyles}
6161
$styles={props.styles}
62-
as={props.url ? props.componentLink : props.as ?? OptionDivStyled}
62+
as={props.url ? props.componentLink : (props.as ?? OptionDivStyled)}
6363
data-testid={props.dataTestId}
6464
role={props.role}
6565
tabIndex={props.tabIndex}

src/components/table/hooks/useContent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export const useContent = (props: IUseContent): IUseContentResponse => {
7979
const hasFooter = !!props.footer;
8080
const getExpandedAria = () =>
8181
showExpandedContent
82-
? props.value.accordionIconExpandedAriaLabel ?? props.accordionIconExpandedAriaLabel
83-
: props.value.accordionIconCollapsedAriaLabel ?? props.accordionIconCollapsedAriaLabel;
82+
? (props.value.accordionIconExpandedAriaLabel ?? props.accordionIconExpandedAriaLabel)
83+
: (props.value.accordionIconCollapsedAriaLabel ?? props.accordionIconCollapsedAriaLabel);
8484

8585
const getValue = (headerValue: ITableHeader): string | JSX.Element | DividerContent => {
8686
if (headerValue.value) {

src/components/table/stories/mockTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export const mockCustomizableTable = {
492492
<div>{value.surname}</div>
493493
</div>
494494
) : (
495-
value.name.value ?? value.name
495+
(value.name.value ?? value.name)
496496
),
497497
},
498498
{

src/components/toggle/components/toggleThreePosition.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ const ToggleThreePositionComponent = (
3535
position === POSITIONS.CENTER
3636
? inputValues.centerInputValue
3737
: position === POSITIONS.RIGHT
38-
? inputValues.rightInputValue ?? props.onIcon?.altText
39-
: inputValues.leftInputValue ?? props.offIcon?.altText;
38+
? (inputValues.rightInputValue ?? props.onIcon?.altText)
39+
: (inputValues.leftInputValue ?? props.offIcon?.altText);
4040

4141
const buildTextOrIcon = (position: POSITIONS) => {
4242
return (
@@ -153,7 +153,7 @@ const ToggleThreePositionComponent = (
153153
hasThreePositions={props.hasThreePositions}
154154
id={props.id}
155155
styles={props.styles}
156-
tabIndex={!props.disabled ? props.tabIndex ?? 0 : undefined}
156+
tabIndex={!props.disabled ? (props.tabIndex ?? 0) : undefined}
157157
togglePosition={props.togglePosition}
158158
onKeyDown={e => {
159159
e.persist();

src/components/toggle/components/toggleTwoPositions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const ToggleTwoPositionComponent = (
5555
id={props.id}
5656
role={ROLES.SWITCH}
5757
styles={props.styles}
58-
tabIndex={!props.disabled ? props.tabIndex ?? 0 : undefined}
58+
tabIndex={!props.disabled ? (props.tabIndex ?? 0) : undefined}
5959
togglePosition={props.togglePosition}
6060
onClick={e => {
6161
e.persist();

src/components/tooltip/positioning/utils/detectOverflow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const detectOverflow = (
2727
const clippingClientRect = rectToClientRect(
2828
getClippingRect({
2929
element:
30-
isElement(element) ?? true
30+
(isElement(element) ?? true)
3131
? (element as Element)
3232
: (element as VirtualElement).contextElement || window.document.documentElement,
3333
boundary,

0 commit comments

Comments
 (0)