Skip to content

The swiss army knife of lossless video/audio editing

lint

Mikael Finstad918277bd7535
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 8fd8d9da..df136786 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -5,7 +5,6 @@ module.exports = {
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/interactive-supports-focus': 0,
'jsx-a11y/control-has-associated-label': 0,
- 'unicorn/prefer-node-protocol': 0, // todo
},
overrides: [
diff --git a/script/postversion.mts b/script/postversion.mts
index 5c0fd4eb..f9b24708 100644
--- a/script/postversion.mts
+++ b/script/postversion.mts
@@ -1,4 +1,4 @@
-import { readFile, writeFile } from 'fs/promises';
+import { readFile, writeFile } from 'node:fs/promises';
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import { DateTime } from 'luxon';
diff --git a/script/xcrun-wrapper.mts b/script/xcrun-wrapper.mts
index 0a28d7c4..924cdef1 100644
--- a/script/xcrun-wrapper.mts
+++ b/script/xcrun-wrapper.mts
@@ -1,6 +1,6 @@
// eslint-disable-line unicorn/filename-case
import { execa } from 'execa';
-import { readFile } from 'fs/promises';
+import { readFile } from 'node:fs/promises';
// we need a wrapper script because altool tends to error out very often
// https://developer.apple.com/forums/thread/698477
diff --git a/src/main/compatPlayer.ts b/src/main/compatPlayer.ts
index 38832651..5f34e3fa 100644
--- a/src/main/compatPlayer.ts
+++ b/src/main/compatPlayer.ts
@@ -1,4 +1,4 @@
-import assert from 'assert';
+import assert from 'node:assert';
import logger from './logger.js';
import { createMediaSourceProcess, readOneJpegFrame as readOneJpegFrameRaw } from './ffmpeg.js';
diff --git a/src/main/configStore.ts b/src/main/configStore.ts
index 9bb44e8d..2f785d90 100644
--- a/src/main/configStore.ts
+++ b/src/main/configStore.ts
@@ -1,7 +1,7 @@
import Store from 'electron-store';
// eslint-disable-next-line import/no-extraneous-dependencies
import electron from 'electron';
-import { join, dirname } from 'path';
+import { join, dirname } from 'node:path';
import { pathExists } from 'fs-extra';
import { KeyBinding, Config } from '../../types.js';
diff --git a/src/main/ffmpeg.ts b/src/main/ffmpeg.ts
index 3d68d7c0..847b1855 100644
--- a/src/main/ffmpeg.ts
+++ b/src/main/ffmpeg.ts
@@ -1,9 +1,9 @@
-import { join } from 'path';
-import readline from 'readline';
+import { join } from 'node:path';
+import readline from 'node:readline';
import stringToStream from 'string-to-stream';
import { BufferEncodingOption, execa, ExecaChildProcess, Options as ExecaOptions } from 'execa';
-import assert from 'assert';
-import { Readable } from 'stream';
+import assert from 'node:assert';
+import { Readable } from 'node:stream';
// eslint-disable-next-line import/no-extraneous-dependencies
import { app } from 'electron';
diff --git a/src/main/httpServer.ts b/src/main/httpServer.ts
index 2ce4a5ea..e48f1eda 100644
--- a/src/main/httpServer.ts
+++ b/src/main/httpServer.ts
@@ -1,8 +1,8 @@
import express from 'express';
import morgan from 'morgan';
-import http from 'http';
+import http from 'node:http';
import asyncHandler from 'express-async-handler';
-import assert from 'assert';
+import assert from 'node:assert';
import { homepage } from './constants.js';
import logger from './logger.js';
diff --git a/src/main/i18nCommon.ts b/src/main/i18nCommon.ts
index 3738ab12..11a06c60 100644
--- a/src/main/i18nCommon.ts
+++ b/src/main/i18nCommon.ts
@@ -2,7 +2,7 @@
// const LanguageDetector = window.require('i18next-electron-language-detector');
// eslint-disable-next-line import/no-extraneous-dependencies
import { app } from 'electron';
-import { join } from 'path';
+import { join } from 'node:path';
import { InitOptions } from 'i18next';
diff --git a/src/main/index.ts b/src/main/index.ts
index 4c05a339..0120d548 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -11,8 +11,8 @@ import debounce from 'lodash/debounce';
import yargsParser from 'yargs-parser';
import JSON5 from 'json5';
import remote from '@electron/remote/main';
-import { stat } from 'fs/promises';
-import assert from 'assert';
+import { stat } from 'node:fs/promises';
+import assert from 'node:assert';
import logger from './logger.js';
import menu from './menu.js';
diff --git a/src/main/logger.ts b/src/main/logger.ts
index 890dc41a..0ca51254 100644
--- a/src/main/logger.ts
+++ b/src/main/logger.ts
@@ -1,8 +1,8 @@
import winston from 'winston';
-import util from 'util';
+import util from 'node:util';
// eslint-disable-next-line import/no-extraneous-dependencies
import { app } from 'electron';
-import { join } from 'path';
+import { join } from 'node:path';
// eslint-disable-next-line import/no-extraneous-dependencies
import type { TransformableInfo } from 'logform';
diff --git a/src/main/util.ts b/src/main/util.ts
index 75724c95..9c3f1da7 100644
--- a/src/main/util.ts
+++ b/src/main/util.ts
@@ -1,4 +1,4 @@
-import os from 'os';
+import os from 'node:os';
export const platform = os.platform();
export const arch = os.arch();
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index f3b13fca..404a2b9c 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -2529,7 +2529,6 @@ function App() {
<AnimatePresence>
{showLeftBar && (
<BatchFilesList
- // @ts-expect-error todo
selectedBatchFiles={selectedBatchFiles}
filePath={filePath}
width={leftBarWidth}
@@ -2696,7 +2695,6 @@ function App() {
/>
<BottomBar
- // @ts-expect-error todo
zoom={zoom}
setZoom={setZoom}
timelineToggleComfortZoom={timelineToggleComfortZoom}
diff --git a/src/renderer/src/edlFormats.test.ts b/src/renderer/src/edlFormats.test.ts
index d474837b..dd55ab6e 100644
--- a/src/renderer/src/edlFormats.test.ts
+++ b/src/renderer/src/edlFormats.test.ts
@@ -1,6 +1,6 @@
-import fs from 'fs/promises';
-import { join, dirname } from 'path';
-import { fileURLToPath } from 'url';
+import fs from 'node:fs/promises';
+import { join, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
import { it, describe, expect } from 'vitest';
diff --git a/src/renderer/src/hooks/useFrameCapture.ts b/src/renderer/src/hooks/useFrameCapture.ts
index 9823b58c..41335e1c 100644
--- a/src/renderer/src/hooks/useFrameCapture.ts
+++ b/src/renderer/src/hooks/useFrameCapture.ts
@@ -1,7 +1,7 @@
import dataUriToBuffer from 'data-uri-to-buffer';
import pMap from 'p-map';
import { useCallback } from 'react';
-import type * as FsPromises from 'fs/promises';
+import type * as FsPromises from 'node:fs/promises';
import { getSuffixedOutPath, getOutDir, transferTimestamps, getSuffixedFileName, getOutPath, escapeRegExp, fsOperationWithRetry } from '../util';
import { getNumDigits } from '../segments';
diff --git a/src/renderer/src/index.tsx b/src/renderer/src/index.tsx
index ab711c4d..02a21bee 100644
--- a/src/renderer/src/index.tsx
+++ b/src/renderer/src/index.tsx
@@ -4,7 +4,7 @@ import { MotionConfig } from 'framer-motion';
import { enableMapSet } from 'immer';
import * as Electron from 'electron';
import Remote from '@electron/remote';
-import type path from 'path';
+import type path from 'node:path';
import 'sweetalert2/dist/sweetalert2.css';
diff --git a/src/renderer/src/util.ts b/src/renderer/src/util.ts
index 050ddce1..dd5b8692 100644
--- a/src/renderer/src/util.ts
+++ b/src/renderer/src/util.ts
@@ -5,9 +5,9 @@ import prettyBytes from 'pretty-bytes';
import sortBy from 'lodash/sortBy';
import pRetry, { Options } from 'p-retry';
import { ExecaError } from 'execa';
-import type * as FsPromises from 'fs/promises';
+import type * as FsPromises from 'node:fs/promises';
import type * as FsExtra from 'fs-extra';
-import type { PlatformPath } from 'path';
+import type { PlatformPath } from 'node:path';
import isDev from './isDev';
import Swal, { toast } from './swal';
diff --git a/src/renderer/src/util/outputNameTemplate.ts b/src/renderer/src/util/outputNameTemplate.ts
index 6c83f2ed..1c7a8c75 100644
--- a/src/renderer/src/util/outputNameTemplate.ts
+++ b/src/renderer/src/util/outputNameTemplate.ts
@@ -1,6 +1,6 @@
import i18n from 'i18next';
import lodashTemplate from 'lodash/template';
-import { PlatformPath } from 'path';
+import { PlatformPath } from 'node:path';
import { isMac, isWindows, hasDuplicates, filenamify, getOutFileExtension } from '../util';
import isDev from '../isDev';