More lints
This commit is contained in:
@@ -19,18 +19,8 @@ export default [
|
||||
"@typescript-eslint/no-unsafe-call": "off",
|
||||
/** TODO: Disabled as we migrate, try to prune these again */
|
||||
"@typescript-eslint/no-floating-promises": "off",
|
||||
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/prefer-promise-reject-errors": "off",
|
||||
"@typescript-eslint/no-useless-constructor": "off",
|
||||
"@typescript-eslint/require-await": "off",
|
||||
"@typescript-eslint/no-misused-promises": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-base-to-string": "off",
|
||||
"@typescript-eslint/restrict-plus-operands": "off",
|
||||
"@typescript-eslint/no-unused-expressions": "off",
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"react-refresh/only-export-components": "off",
|
||||
},
|
||||
|
||||
@@ -211,7 +211,7 @@ const AllAlbumsContent: React.FC<AllAlbumsContentProps> = ({
|
||||
if (!collectionSummaries) {
|
||||
return;
|
||||
}
|
||||
const main = async () => {
|
||||
const main = () => {
|
||||
if (refreshInProgress.current) {
|
||||
shouldRefresh.current = true;
|
||||
return;
|
||||
|
||||
@@ -1673,7 +1673,7 @@ const ManageLinkPassword: React.FC<ManagePublicLinkSettingProps> = ({
|
||||
const { show: showSetPassword, props: setPasswordVisibilityProps } =
|
||||
useModalVisibility();
|
||||
|
||||
const handlePasswordChangeSetting = async () => {
|
||||
const handlePasswordChangeSetting = () => {
|
||||
if (publicURL.passwordEnabled) {
|
||||
showMiniDialog({
|
||||
title: t("disable_password"),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TODO: Audit this file
|
||||
/* eslint-disable @typescript-eslint/restrict-plus-operands */
|
||||
import AlbumOutlinedIcon from "@mui/icons-material/AlbumOutlined";
|
||||
import FavoriteRoundedIcon from "@mui/icons-material/FavoriteRounded";
|
||||
import PlayCircleOutlineOutlinedIcon from "@mui/icons-material/PlayCircleOutlineOutlined";
|
||||
|
||||
@@ -567,6 +567,7 @@ export const Upload: React.FC<UploadProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
let showNextModal = () => {};
|
||||
if (importSuggestion.hasNestedFolders) {
|
||||
showNextModal = () => setOpenCollectionMappingChoice(true);
|
||||
@@ -586,7 +587,7 @@ export const Upload: React.FC<UploadProps> = ({
|
||||
})();
|
||||
}, [webFiles, desktopFiles, desktopFilePaths, desktopZipItems]);
|
||||
|
||||
const preCollectionCreationAction = async () => {
|
||||
const preCollectionCreationAction = () => {
|
||||
onCloseCollectionSelector?.();
|
||||
props.setShouldDisableDropzone(uploadManager.isUploadInProgress());
|
||||
setUploadPhase("preparing");
|
||||
@@ -597,7 +598,7 @@ export const Upload: React.FC<UploadProps> = ({
|
||||
collection: Collection,
|
||||
uploaderName?: string,
|
||||
) => {
|
||||
await preCollectionCreationAction();
|
||||
preCollectionCreationAction();
|
||||
const uploadItemsWithCollection = uploadItemsAndPaths.current.map(
|
||||
([uploadItem, path], index) => ({
|
||||
uploadItem,
|
||||
@@ -618,7 +619,7 @@ export const Upload: React.FC<UploadProps> = ({
|
||||
mapping: CollectionMapping,
|
||||
collectionName?: string,
|
||||
) => {
|
||||
await preCollectionCreationAction();
|
||||
preCollectionCreationAction();
|
||||
let uploadItemsWithCollection: UploadItemWithCollection[] = [];
|
||||
let collectionNameToUploadItems = new Map<
|
||||
string,
|
||||
@@ -821,7 +822,7 @@ export const Upload: React.FC<UploadProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const handlePublicUpload = async (uploaderName: string) => {
|
||||
const handlePublicUpload = (uploaderName: string) => {
|
||||
savePublicCollectionUploaderName(
|
||||
publicCollectionGalleryContext.credentials.accessToken,
|
||||
uploaderName,
|
||||
@@ -1210,20 +1211,22 @@ const UploadOptions: React.FC<UploadOptionsProps> = ({
|
||||
onSelect("folders");
|
||||
break;
|
||||
case "zips":
|
||||
!showTakeoutOptions
|
||||
? setShowTakeoutOptions(true)
|
||||
: onSelect("zips");
|
||||
if (!showTakeoutOptions) {
|
||||
setShowTakeoutOptions(true);
|
||||
} else {
|
||||
onSelect("zips");
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
return !showTakeoutOptions ? (
|
||||
return showTakeoutOptions ? (
|
||||
<TakeoutOptions onSelect={handleSelect} onClose={handleTakeoutClose} />
|
||||
) : (
|
||||
<DefaultOptions
|
||||
{...{ intent, pendingUploadType, onClose }}
|
||||
onSelect={handleSelect}
|
||||
/>
|
||||
) : (
|
||||
<TakeoutOptions onSelect={handleSelect} onClose={handleTakeoutClose} />
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ export const WatchFolder: React.FC<ModalVisibilityProps> = ({
|
||||
|
||||
interface WatchList {
|
||||
watches: FolderWatch[] | undefined;
|
||||
removeWatch: (watch: FolderWatch) => void;
|
||||
removeWatch: (watch: FolderWatch) => Promise<void>;
|
||||
}
|
||||
|
||||
const WatchList: React.FC<WatchList> = ({ watches, removeWatch }) =>
|
||||
@@ -201,13 +201,13 @@ const Check: React.FC = () => (
|
||||
|
||||
interface WatchEntryProps {
|
||||
watch: FolderWatch;
|
||||
removeWatch: (watch: FolderWatch) => void;
|
||||
removeWatch: (watch: FolderWatch) => Promise<void>;
|
||||
}
|
||||
|
||||
const WatchEntry: React.FC<WatchEntryProps> = ({ watch, removeWatch }) => {
|
||||
const { showMiniDialog } = useBaseContext();
|
||||
|
||||
const confirmStopWatching = () => {
|
||||
const confirmStopWatching = () =>
|
||||
showMiniDialog({
|
||||
title: t("stop_watching_folder_title"),
|
||||
message: t("stop_watching_folder_message"),
|
||||
@@ -217,7 +217,6 @@ const WatchEntry: React.FC<WatchEntryProps> = ({ watch, removeWatch }) => {
|
||||
action: () => removeWatch(watch),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<SpacedRow sx={{ overflow: "hidden", flexShrink: 0 }}>
|
||||
|
||||
@@ -1337,7 +1337,7 @@ export async function handleSubscriptionCompletionRedirectIfNeeded(
|
||||
);
|
||||
}
|
||||
} else if (status == "fail") {
|
||||
log.error(`Subscription purchase failed: ${reason}`);
|
||||
log.error(`Subscription purchase failed`, reason);
|
||||
switch (reason) {
|
||||
case "canceled":
|
||||
showMiniDialog({
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// TODO: Audit this file
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
||||
import AddPhotoAlternateOutlinedIcon from "@mui/icons-material/AddPhotoAlternateOutlined";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import DownloadIcon from "@mui/icons-material/Download";
|
||||
|
||||
@@ -101,8 +101,8 @@ class UIService {
|
||||
// UPLOAD LEVEL STATES
|
||||
private uploadPhase: UploadPhase = "preparing";
|
||||
private filenames = new Map<number, string>();
|
||||
private hasLivePhoto: boolean = false;
|
||||
private uploadProgressView: boolean = false;
|
||||
private hasLivePhoto = false;
|
||||
private uploadProgressView = false;
|
||||
|
||||
// STAGE LEVEL STATES
|
||||
private perFileProgress: number;
|
||||
@@ -269,7 +269,7 @@ class UploadManager {
|
||||
|
||||
private uiService = new UIService();
|
||||
|
||||
public async init(
|
||||
public init(
|
||||
progressUpdater: ProgressUpdater,
|
||||
onUploadFile: (file: EnteFile) => void,
|
||||
publicAlbumsCredentials: PublicAlbumsCredentials | undefined,
|
||||
@@ -571,7 +571,7 @@ class UploadManager {
|
||||
}
|
||||
|
||||
if (isDesktop && watcher.isUploadRunning()) {
|
||||
await watcher.onFileUpload(uploadableItem, uploadResult);
|
||||
watcher.onFileUpload(uploadableItem, uploadResult);
|
||||
}
|
||||
|
||||
return type == "addedSymlink" ? "uploaded" : type;
|
||||
|
||||
@@ -74,6 +74,8 @@ class FolderWatcher {
|
||||
private debouncedRunNextEvent: () => void;
|
||||
|
||||
constructor() {
|
||||
// TODO:
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
this.debouncedRunNextEvent = debounce(() => this.runNextEvent(), 1000);
|
||||
}
|
||||
|
||||
@@ -319,10 +321,7 @@ class FolderWatcher {
|
||||
* Callback invoked by the uploader whenever a item we requested to
|
||||
* {@link upload} gets uploaded.
|
||||
*/
|
||||
async onFileUpload(
|
||||
item: UploadItemWithCollection,
|
||||
uploadResult: UploadResult,
|
||||
) {
|
||||
onFileUpload(item: UploadItemWithCollection, uploadResult: UploadResult) {
|
||||
// Re the usage of ensureString: For desktop watch, the only possibility
|
||||
// for a UploadItem is for it to be a string (the absolute path to a
|
||||
// file on disk).
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-base-to-string */
|
||||
// TODO: Audit this file
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import {
|
||||
parseDateFromDigitGroups,
|
||||
@@ -163,13 +166,13 @@ export async function testUpload() {
|
||||
await exifDataParsingCheck(expectedState);
|
||||
await fileDimensionExtractionCheck(expectedState);
|
||||
await googleMetadataReadingCheck(expectedState);
|
||||
await totalFileCountCheck(expectedState);
|
||||
totalFileCountCheck(expectedState);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
async function totalFileCountCheck(expectedState) {
|
||||
function totalFileCountCheck(expectedState) {
|
||||
const userDetails = userDetailsSnapshot();
|
||||
if (expectedState.total_file_count === userDetails.fileCount) {
|
||||
console.log("file count check passed ✅");
|
||||
|
||||
@@ -29,7 +29,7 @@ type UploaderNameInput = ModalVisibilityProps & {
|
||||
/**
|
||||
* Callback invoked when the user presses submit after entering a name.
|
||||
*/
|
||||
onSubmit: (name: string) => Promise<void>;
|
||||
onSubmit: (name: string) => void | Promise<void>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user