Skip to content

Commit

Permalink
fix: ignore eslint instead of casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Pader committed Sep 13, 2023
1 parent e3ce763 commit 7cd0eeb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/styles/StyleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,12 @@ function getSafeAreaMargins(insets?: EdgeInsets): ViewStyle | CSSProperties {

function getZoomCursorStyle(isZoomed: boolean, isDragging: boolean): ViewStyle | CSSProperties {
if (!isZoomed) {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return styles.cursorZoomIn;
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return isDragging ? styles.cursorGrabbing : styles.cursorZoomOut;
}

Expand Down Expand Up @@ -336,12 +339,16 @@ function getWidthStyle(width: number): ViewStyle | CSSProperties {
*/
function getAutoGrowHeightInputStyle(textInputHeight: number, maxHeight: number): ViewStyle | CSSProperties {
if (textInputHeight > maxHeight) {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...styles.pr0,
...styles.overflowAuto,
};
}

// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...styles.pr0,
...styles.overflowHidden,
Expand Down Expand Up @@ -439,11 +446,17 @@ function getBackgroundColorWithOpacityStyle(backgroundColor: string, opacity: nu
function getBadgeColorStyle(success: boolean, error: boolean, isPressed = false, isAdHoc = false): ViewStyle | CSSProperties {
if (success) {
if (isAdHoc) {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return isPressed ? styles.badgeAdHocSuccessPressed : styles.badgeAdHocSuccess;
}
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return isPressed ? styles.badgeSuccessPressed : styles.badgeSuccess;
}
if (error) {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return isPressed ? styles.badgeDangerPressed : styles.badgeDanger;
}
return {};
Expand Down Expand Up @@ -593,6 +606,8 @@ function getLoginPagePromoStyle(): ViewStyle | CSSProperties {
* Generate the styles for the ReportActionItem wrapper view.
*/
function getReportActionItemStyle(isHovered = false, isLoading = false): ViewStyle | CSSProperties {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
display: 'flex',
justifyContent: 'space-between',
Expand All @@ -609,6 +624,8 @@ function getReportActionItemStyle(isHovered = false, isLoading = false): ViewSty
* Generate the wrapper styles for the mini ReportActionContextMenu.
*/
function getMiniReportActionContextMenuWrapperStyle(isReportActionItemGrouped: boolean): ViewStyle | CSSProperties {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...(isReportActionItemGrouped ? positioning.tn8 : positioning.tn4),
...positioning.r4,
Expand Down Expand Up @@ -1043,6 +1060,8 @@ function displayIfTrue(condition: boolean): ViewStyle | CSSProperties {

function getGoogleListViewStyle(shouldDisplayBorder: boolean): ViewStyle | CSSProperties {
if (shouldDisplayBorder) {
// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...styles.borderTopRounded,
...styles.borderBottomRounded,
Expand Down Expand Up @@ -1150,6 +1169,8 @@ function getDisabledLinkStyles(isDisabled = false): ViewStyle | CSSProperties {
...cursor.cursorDisabled,
};

// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...styles.link,
...(isDisabled ? disabledLinkStyles : {}),
Expand Down
2 changes: 2 additions & 0 deletions src/styles/getReportActionContextMenuStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function getReportActionContextMenuStyles(isMini: boolean, isSmallScreenWidth: b
return miniWrapperStyle;
}

// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return [
...bigWrapperStyle,

Expand Down
2 changes: 2 additions & 0 deletions src/styles/useThemeStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function useThemeStyles() {
throw new Error('StylesContext was null! Are you sure that you wrapped the component under a <ThemeStylesProvider>?');
}

// TODO: Remove this "eslint-disable-next" once the theme switching migration is done and styles are fully typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return themeStyles;
}

Expand Down

0 comments on commit 7cd0eeb

Please sign in to comment.