Skip to content

Commit adbc6a2

Browse files
authored
Merge pull request Expensify#72011 from callstack-internal/eslint-9-no-unsafe-call
[NO QA] Eslint9 - fix @typescript-eslint/no-unsafe-call
2 parents 09a7472 + 3ceaada commit adbc6a2

86 files changed

Lines changed: 124 additions & 120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ const config = defineConfig([
399399
// These rules could indicate potential bugs in the source code.
400400
// After fixing the source code, remove these so they become errors instead of warnings.
401401
'@typescript-eslint/no-base-to-string': 'warn',
402-
'@typescript-eslint/no-unsafe-call': 'warn',
403402

404403
// @typescript-eslint/lines-between-class-members was moved to @stylistic/eslint-plugin, so replaced with lines-between-class-members.
405404
'lines-between-class-members': 'error',

scripts/aggregateGitHubDataFromUpwork.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ async function getGitHubData() {
156156
const type = getIssueTypeFromLabels(labels);
157157
let capSWProjects = '';
158158
if (type === 'feature') {
159-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
160159
capSWProjects = await getProjectsForIssue(issueNumber);
161160
}
162161
gitHubData.push({

src/components/AttachmentModal.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type {TranslationPaths} from '@src/languages/types';
2525
import ONYXKEYS from '@src/ONYXKEYS';
2626
import ROUTES from '@src/ROUTES';
2727
import type * as OnyxTypes from '@src/types/onyx';
28+
import type {FileObject} from '@src/types/utils/Attachment';
2829
import {isEmptyObject} from '@src/types/utils/EmptyObject';
2930
import viewRef from '@src/types/utils/viewRef';
3031
import AttachmentCarousel from './Attachments/AttachmentCarousel';
@@ -48,17 +49,6 @@ import SafeAreaConsumer from './SafeAreaConsumer';
4849
* to display a full size image or PDF modally with optional confirmation button.
4950
*/
5051

51-
type ImagePickerResponse = {
52-
height?: number;
53-
name: string;
54-
size?: number | null;
55-
type: string;
56-
uri: string;
57-
width?: number;
58-
};
59-
60-
type FileObject = Partial<File | ImagePickerResponse>;
61-
6252
type ChildrenProps = {
6353
show: () => void;
6454
};
@@ -603,5 +593,3 @@ function AttachmentModal({
603593
AttachmentModal.displayName = 'AttachmentModal';
604594

605595
export default memo(AttachmentModal);
606-
607-
export type {FileObject, ImagePickerResponse};

src/components/AttachmentPicker/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import useStyleUtils from '@hooks/useStyleUtils';
1919
import useTheme from '@hooks/useTheme';
2020
import useThemeStyles from '@hooks/useThemeStyles';
2121
import {cleanFileName, resizeImageIfNeeded, showCameraPermissionsAlert, verifyFileFormat} from '@libs/fileDownload/FileUtils';
22-
import type {FileObject, ImagePickerResponse as FileResponse} from '@pages/media/AttachmentModalScreen/types';
2322
import CONST from '@src/CONST';
2423
import type {TranslationPaths} from '@src/languages/types';
24+
import type {FileObject, ImagePickerResponse as FileResponse} from '@src/types/utils/Attachment';
2525
import type IconAsset from '@src/types/utils/IconAsset';
2626
import launchCamera from './launchCamera/launchCamera';
2727
import type AttachmentPickerProps from './types';

src/components/AttachmentPicker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React, {useRef} from 'react';
22
import type {ValueOf} from 'type-fest';
33
import {isMobileChrome} from '@libs/Browser';
44
import Visibility from '@libs/Visibility';
5-
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
65
import CONST from '@src/CONST';
6+
import type {FileObject} from '@src/types/utils/Attachment';
77
import type AttachmentPickerProps from './types';
88

99
/**

src/components/AttachmentPicker/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type {ReactNode} from 'react';
22
import type {ValueOf} from 'type-fest';
3-
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
43
import type CONST from '@src/CONST';
4+
import type {FileObject} from '@src/types/utils/Attachment';
55

66
type PickerOptions = {
77
/** A callback that will be called with the selected attachments. */

src/components/Attachments/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
1+
import type {FileObject} from '@src/types/utils/Attachment';
22
import type IconAsset from '@src/types/utils/IconAsset';
33

44
type AttachmentSource = string | IconAsset | number;

src/components/AvatarWithImagePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import {validateAvatarImage} from '@libs/AvatarUtils';
99
import {isSafari} from '@libs/Browser';
1010
import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types';
1111
import type {AvatarSource} from '@libs/UserUtils';
12-
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
1312
import CONST from '@src/CONST';
1413
import type {TranslationPaths} from '@src/languages/types';
1514
import type * as OnyxCommon from '@src/types/onyx/OnyxCommon';
15+
import type {FileObject} from '@src/types/utils/Attachment';
1616
import type IconAsset from '@src/types/utils/IconAsset';
1717
import AttachmentModal from './AttachmentModal';
1818
import AttachmentPicker from './AttachmentPicker';

src/components/Composer/implementation/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import useThemeStyles from '@hooks/useThemeStyles';
1414
import {containsOnlyEmojis} from '@libs/EmojiUtils';
1515
import {splitExtensionFromFileName} from '@libs/fileDownload/FileUtils';
1616
import Parser from '@libs/Parser';
17-
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
1817
import getFileSize from '@pages/Share/getFileSize';
1918
import CONST from '@src/CONST';
19+
import type {FileObject} from '@src/types/utils/Attachment';
2020

2121
const excludeNoStyles: Array<keyof MarkdownStyle> = [];
2222
const excludeReportMentionStyle: Array<keyof MarkdownStyle> = ['mentionReport'];

src/components/Composer/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {NativeSyntheticEvent, StyleProp, TextInputProps, TextInputSelectionChangeEventData, TextStyle} from 'react-native';
2-
import type {FileObject} from '@pages/media/AttachmentModalScreen/types';
2+
import type {FileObject} from '@src/types/utils/Attachment';
33

44
type TextSelection = {
55
start: number;

0 commit comments

Comments
 (0)