Fix lint errors

This commit is contained in:
jeromewu 2023-10-11 22:04:25 +08:00
parent 70661340b4
commit 147596bdb0
3 changed files with 5 additions and 6 deletions

View File

@ -13,7 +13,6 @@ import {
LogEventCallback, LogEventCallback,
ProgressEventCallback, ProgressEventCallback,
FileData, FileData,
WorkerFSMountData,
FFFSType, FFFSType,
FFFSMountOptions, FFFSMountOptions,
FFFSPath, FFFSPath,

View File

@ -153,7 +153,7 @@ export type CallbackData =
| LogEvent | LogEvent
| ProgressEvent | ProgressEvent
| IsFirst | IsFirst
| OK | OK // eslint-disable-line
| Error | Error
| FSNode[] | FSNode[]
| undefined; | undefined;
@ -171,4 +171,4 @@ export interface FFMessageEventCallback {
type: string; type: string;
data: CallbackData; data: CallbackData;
}; };
} }

View File

@ -140,8 +140,8 @@ const deleteDir = ({ path }: FFMessageDeleteDirData): OK => {
}; };
const mount = ({ fsType, options, mountPoint }: FFMessageMountData): OK => { const mount = ({ fsType, options, mountPoint }: FFMessageMountData): OK => {
let str = fsType as keyof typeof ffmpeg.FS.filesystems; const str = fsType as keyof typeof ffmpeg.FS.filesystems;
let fs = ffmpeg.FS.filesystems[str]; const fs = ffmpeg.FS.filesystems[str];
if (!fs) return false; if (!fs) return false;
ffmpeg.FS.mount(fs, options, mountPoint); ffmpeg.FS.mount(fs, options, mountPoint);
return true; return true;
@ -158,7 +158,7 @@ self.onmessage = async ({
const trans = []; const trans = [];
let data: CallbackData; let data: CallbackData;
try { try {
if (type !== FFMessageType.LOAD && !ffmpeg) throw ERROR_NOT_LOADED; if (type !== FFMessageType.LOAD && !ffmpeg) throw ERROR_NOT_LOADED; // eslint-disable-line
switch (type) { switch (type) {
case FFMessageType.LOAD: case FFMessageType.LOAD: