diff --git a/.eslintrc.cli.json b/.eslintrc.cli.json index 8694b65377d0d..79eaaeba294a5 100644 --- a/.eslintrc.cli.json +++ b/.eslintrc.cli.json @@ -7,7 +7,12 @@ "files": ["**/*.ts", "**/*.tsx"], // Linting with type-checked rules is very slow and needs a lot of memory, // so we exclude non-essential files. - "excludedFiles": ["examples/**/*", "test/**/*", "**/*.d.ts"], + "excludedFiles": [ + "examples/**/*", + "test/**/*", + "**/*.d.ts", + "turbopack/**/*" + ], "parserOptions": { "project": true }, diff --git a/.eslintrc.json b/.eslintrc.json index c56d6f147c53e..722a752fddfa8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,7 +12,8 @@ "commonjs": true, "es6": true, "node": true, - "jest": true + "jest": true, + "es2020": true }, "parserOptions": { "requireConfigFile": false, @@ -101,7 +102,11 @@ "error", { "args": "none", - "ignoreRestSiblings": true + "ignoreRestSiblings": true, + "argsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_" } ], "no-use-before-define": "off", diff --git a/turbopack/crates/turbo-tasks-memory/src/aggregation/loom_tests.rs b/turbopack/crates/turbo-tasks-memory/src/aggregation/loom_tests.rs index f5750e3c27aab..d9e9f6b600c79 100644 --- a/turbopack/crates/turbo-tasks-memory/src/aggregation/loom_tests.rs +++ b/turbopack/crates/turbo-tasks-memory/src/aggregation/loom_tests.rs @@ -97,7 +97,10 @@ struct NodeGuard { impl NodeGuard { unsafe fn new(guard: MutexGuard<'_, NodeInner>, node: Arc) -> Self { NodeGuard { - guard: unsafe { std::mem::transmute(guard) }, + // #[allow(clippy::missing_transmute_annotations, reason = "this is a test")] + guard: unsafe { + std::mem::transmute::, MutexGuard<'_, NodeInner>>(guard) + }, node, } } diff --git a/turbopack/crates/turbo-tasks-memory/src/aggregation/tests.rs b/turbopack/crates/turbo-tasks-memory/src/aggregation/tests.rs index 4cdcbd38e41df..5d1ce24b39beb 100644 --- a/turbopack/crates/turbo-tasks-memory/src/aggregation/tests.rs +++ b/turbopack/crates/turbo-tasks-memory/src/aggregation/tests.rs @@ -38,12 +38,10 @@ fn find_root(mut node: NodeRef) -> NodeRef { } } -fn check_invariants<'a>( - ctx: &NodeAggregationContext<'a>, - node_ids: impl IntoIterator, -) { +fn check_invariants(ctx: &NodeAggregationContext<'_>, node_ids: impl IntoIterator) { let mut queue = node_ids.into_iter().collect::>(); // print(ctx, &queue[0], true); + #[allow(clippy::mutable_key_type, reason = "this is a test")] let mut visited = HashSet::new(); while let Some(node_id) = queue.pop() { assert_eq!(node_id.0.atomic.load(Ordering::SeqCst), 0); @@ -428,7 +426,9 @@ struct NodeGuard { impl NodeGuard { unsafe fn new(guard: MutexGuard<'_, NodeInner>, node: Arc) -> Self { NodeGuard { - guard: unsafe { std::mem::transmute(guard) }, + guard: unsafe { + std::mem::transmute::, MutexGuard<'_, NodeInner>>(guard) + }, node, } } diff --git a/turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs b/turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs index b58ea58964bff..6260f4386e591 100644 --- a/turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs +++ b/turbopack/crates/turbo-tasks-memory/tests/all_in_one.rs @@ -60,26 +60,26 @@ async fn all_in_one() { let vc_42 = Vc::cell(42); let option: Vc>> = Vc::cell(Some(vc_42)); - assert_eq!(*option.is_some().await?, true); - assert_eq!(*option.is_none().await?, false); + assert!(*option.is_some().await?); + assert!(!(*option.is_none().await?)); assert_eq!(&*option.await?, &Some(vc_42)); assert_eq!(option.dbg().await?.to_string(), "Some(\n 42,\n)"); let option: Vc>> = Default::default(); - assert_eq!(*option.is_some().await?, false); - assert_eq!(*option.is_none().await?, true); + assert!(!(*option.is_some().await?)); + assert!(*option.is_none().await?); assert_eq!(&*option.await?, &None); assert_eq!(option.dbg().await?.to_string(), "None"); let vec: Vc>> = Vc::cell(vec![vc_42]); assert_eq!(*vec.len().await?, 1); - assert_eq!(*vec.is_empty().await?, false); + assert!(!(*vec.is_empty().await?)); assert_eq!(&*vec.await?, &[vc_42]); assert_eq!(vec.dbg().await?.to_string(), "[\n 42,\n]"); let vec: Vc>> = Default::default(); assert_eq!(*vec.len().await?, 0); - assert_eq!(*vec.is_empty().await?, true); + assert!(*vec.is_empty().await?); assert_eq!(vec.dbg().await?.to_string(), "[]"); let vec: Vc>>>> = Default::default(); @@ -88,25 +88,25 @@ async fn all_in_one() { let set: Vc>> = Vc::cell(IndexSet::from([vc_42])); assert_eq!(*set.len().await?, 1); - assert_eq!(*set.is_empty().await?, false); + assert!(!(*set.is_empty().await?)); assert_eq!(&*set.await?, &IndexSet::from([vc_42])); assert_eq!(set.dbg().await?.to_string(), "{\n 42,\n}"); let set: Vc>> = Default::default(); assert_eq!(*set.len().await?, 0); - assert_eq!(*set.is_empty().await?, true); + assert!(*set.is_empty().await?); assert_eq!(&*set.await?, &IndexSet::>::default()); assert_eq!(set.dbg().await?.to_string(), "{}"); let map: Vc> = Vc::cell(IndexMap::from([(vc_42, vc_42)])); assert_eq!(*map.len().await?, 1); - assert_eq!(*map.is_empty().await?, false); + assert!(!(*map.is_empty().await?)); assert_eq!(&*map.await?, &IndexMap::from([(vc_42, vc_42)])); assert_eq!(map.dbg().await?.to_string(), "{\n 42: 42,\n}"); let map: Vc, Vc>> = Default::default(); assert_eq!(*map.len().await?, 0); - assert_eq!(*map.is_empty().await?, true); + assert!(*map.is_empty().await?); assert_eq!(&*map.await?, &IndexMap::, Vc>::default()); assert_eq!(map.dbg().await?.to_string(), "{}"); diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts index eabcfaa5a5bc8..f839299329602 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts @@ -5,6 +5,8 @@ * This interface will be implemented by runtime backends. */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /// declare var BACKEND: RuntimeBackend; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts index 7896fe904d28d..885c7ab77f487 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts @@ -6,7 +6,7 @@ * shared runtime utils. */ -/* eslint-disable @next/next/no-assign-module-variable */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /// /// @@ -197,7 +197,7 @@ async function loadChunk( if (moduleChunksPromises.length > 0) { // Some module chunks are already loaded or loading. - if (moduleChunksPromises.length == includedModuleChunksList.length) { + if (moduleChunksPromises.length === includedModuleChunksList.length) { // When all included module chunks are already loaded or loading, we can skip loading ourselves return Promise.all(moduleChunksPromises); } @@ -258,6 +258,8 @@ async function loadChunkPath( case SourceType.Update: loadReason = "from an HMR update"; break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); } throw new Error( `Failed to load chunk ${chunkPath} ${loadReason}${ @@ -301,6 +303,8 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { case SourceType.Update: instantiationReason = "because of an HMR update"; break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); } throw new Error( `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.` @@ -324,7 +328,10 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { case SourceType.Update: parents = source.parents || []; break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); } + const module: Module = { exports: {}, error: undefined, @@ -571,6 +578,8 @@ function computedInvalidatedModules( } break; // TODO(alexkirsz) Dependencies: handle dependencies effects. + default: + invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`); } } @@ -752,13 +761,6 @@ function applyPhase( } } -/** - * Utility function to ensure all variants of an enum are handled. - */ -function invariant(never: never, computeMessage: (arg: any) => string): never { - throw new Error(`Invariant: ${computeMessage(never)}`); -} - function applyUpdate(update: PartialUpdate) { switch (update.type) { case "ChunkListUpdate": @@ -800,6 +802,7 @@ function applyChunkListUpdate(update: ChunkListUpdate) { (instruction) => `Unknown partial instruction: ${JSON.stringify(instruction)}.` ); + break; default: invariant( chunkUpdate, diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts index 17295aec962db..9a63aba81f965 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts @@ -5,6 +5,8 @@ * It will be appended to the base development runtime code. */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /// /// @@ -124,7 +126,7 @@ async function loadWebAssemblyModule( `link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]` ); - if (previousLinks.length == 0) { + if (previousLinks.length === 0) { reject(new Error(`No link element found for chunk ${chunkPath}`)); return; } @@ -299,5 +301,6 @@ function _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory { )}`; } + // eslint-disable-next-line no-eval return eval(code); } diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts index 0f4851977a735..232078a3bb90b 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts @@ -5,6 +5,8 @@ * It will be appended to the base development runtime code. */ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /// /// /// @@ -50,7 +52,7 @@ function getFileStem(path: string): string { const stem = fileName.split(".").shift()!; - if (stem == "") { + if (stem === "") { return fileName; } diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts index 54a0244f524fd..d2aa4f0e7158c 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /// /// /// @@ -31,6 +33,8 @@ function stringifySourceInfo(source: SourceInfo): string { return `runtime for chunk ${source.chunkPath}`; case SourceType.Parent: return `parent module ${source.parentId}`; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); } } @@ -187,6 +191,8 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { case SourceType.Parent: instantiationReason = `because it was required from module ${source.parentId}`; break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); } throw new Error( `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.` @@ -203,6 +209,8 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { // has already been taken care of in `getOrInstantiateModuleFromParent`. parents = [source.parentId]; break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); } const module: Module = { @@ -242,7 +250,7 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { P: resolveAbsolutePath, U: relativeURL, R: createResolvePathFromModule(r), - __dirname: module.id.replace(/(^|\/)[\/]+$/, ""), + __dirname: module.id.replace(/(^|\/)\/+$/, ""), }); } catch (error) { module.error = error as any; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/base-externals-utils.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/base-externals-utils.ts index a47faf56fe65a..0b7daf938be09 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/base-externals-utils.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/base-externals-utils.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /// /// A 'base' utilities to support runtime can have externals. diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-externals-utils.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-externals-utils.ts index ce2e1d5da5535..dbf44a8fff0c3 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-externals-utils.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-externals-utils.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + declare var RUNTIME_PUBLIC_PATH: string; declare var OUTPUT_ROOT: string; declare var ASSET_PREFIX: string; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-wasm-utils.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-wasm-utils.ts index 1baa2fc01c0c3..542a4773c8c63 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-wasm-utils.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared-node/node-wasm-utils.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /// function readWebAssemblyAsResponse(path: string) { diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts index a3aea592da891..7a6071d133166 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ + /** * This file acts as a dummy implementor for the interface that * `runtime-utils.ts` expects to be available in the global scope. diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts index b79197790fd74..05123f560d993 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts @@ -5,7 +5,7 @@ * It will be prepended to the runtime code of each runtime. */ -/* eslint-disable @next/next/no-assign-module-variable */ +/* eslint-disable @typescript-eslint/no-unused-vars */ /// @@ -514,3 +514,10 @@ const relativeURL = function relativeURL(this: any, inputUrl: string) { }; relativeURL.prototype = URL.prototype; + +/** + * Utility function to ensure all variants of an enum are handled. + */ +function invariant(never: never, computeMessage: (arg: any) => string): never { + throw new Error(`Invariant: ${computeMessage(never)}`); +} diff --git a/turbopack/crates/turbopack-node/js/src/ipc/evaluate.ts b/turbopack/crates/turbopack-node/js/src/ipc/evaluate.ts index beb0c03229c99..9252e77f27d20 100644 --- a/turbopack/crates/turbopack-node/js/src/ipc/evaluate.ts +++ b/turbopack/crates/turbopack-node/js/src/ipc/evaluate.ts @@ -1,4 +1,4 @@ -import { IPC, StructuredError } from "./index"; +import { IPC } from "./index"; import type { Ipc as GenericIpc } from "./index"; type IpcIncomingMessage = diff --git a/turbopack/crates/turbopack-node/js/src/ipc/index.ts b/turbopack/crates/turbopack-node/js/src/ipc/index.ts index fa8d37f0c8a74..0c1820b6790ab 100644 --- a/turbopack/crates/turbopack-node/js/src/ipc/index.ts +++ b/turbopack/crates/turbopack-node/js/src/ipc/index.ts @@ -80,6 +80,8 @@ function createIpc( } break; } + default: + invariant(state, (state) => `Unknown state type: ${state?.type}`); } } }); @@ -207,3 +209,10 @@ improveConsole("timeEnd", "stdout", true); improveConsole("timeLog", "stdout", true); improveConsole("timeStamp", "stdout", true); improveConsole("assert", "stderr", true); + +/** + * Utility function to ensure all variants of an enum are handled. + */ +function invariant(never: never, computeMessage: (arg: any) => string): never { + throw new Error(`Invariant: ${computeMessage(never)}`); +} diff --git a/turbopack/crates/turbopack-node/js/src/transforms/postcss.ts b/turbopack/crates/turbopack-node/js/src/transforms/postcss.ts index 7d7a558a32bac..8bd3abc43b056 100644 --- a/turbopack/crates/turbopack-node/js/src/transforms/postcss.ts +++ b/turbopack/crates/turbopack-node/js/src/transforms/postcss.ts @@ -124,6 +124,9 @@ export default async function transform( glob: "**", }); break; + default: + // TODO: do we need to do anything here? + break; } } return { diff --git a/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts b/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts index ff254a0bccd04..ea0fb75b5cfbe 100644 --- a/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts +++ b/turbopack/crates/turbopack-node/js/src/transforms/webpack-loaders.ts @@ -163,20 +163,6 @@ type ResolveOptions = { roots?: string[]; importFields?: string[]; }; -const SUPPORTED_RESOLVE_OPTIONS = new Set([ - "alias", - "aliasFields", - "conditionNames", - "descriptionFiles", - "extensions", - "exportsFields", - "mainFields", - "mainFiles", - "modules", - "restrictions", - "preferRelative", - "dependencyType", -]); const transform = ( ipc: Ipc, @@ -356,6 +342,9 @@ const transform = ( .join("\n") ); break; + default: + // TODO: do we need to handle this? + break } ipc.sendInfo({ diff --git a/turbopack/crates/turbopack-trace-utils/src/exit.rs b/turbopack/crates/turbopack-trace-utils/src/exit.rs index f8177e48624ae..f9aeea066ed15 100644 --- a/turbopack/crates/turbopack-trace-utils/src/exit.rs +++ b/turbopack/crates/turbopack-trace-utils/src/exit.rs @@ -170,7 +170,7 @@ mod tests { }); receiver.run_exit_handler().await; - assert_eq!(called.load(Ordering::SeqCst), true); + assert!(called.load(Ordering::SeqCst)); } #[tokio::test] diff --git a/turbopack/crates/turbopack/architecture.md b/turbopack/crates/turbopack/architecture.md index f61d13c7d912d..bf582a2082e37 100644 --- a/turbopack/crates/turbopack/architecture.md +++ b/turbopack/crates/turbopack/architecture.md @@ -54,7 +54,7 @@ will hide that async and error in the `XxxVc`. ### Tasks -A combination of a function and its arguments is called a Task (basically an +A combination of a function and its arguments is called a Task (essentially an invocation of a function). It's also possible to store data in a Task via `XxxVc::cell(value: Xxx)`. diff --git a/turbopack/packages/devlow-bench/src/file.ts b/turbopack/packages/devlow-bench/src/file.ts deleted file mode 100644 index 2f50b75e84240..0000000000000 --- a/turbopack/packages/devlow-bench/src/file.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { watch } from "fs"; -import { access, constants } from "fs/promises"; -import { dirname } from "path"; - -export async function waitForFile( - path: string, - timeout: number -): Promise { - let currentAction = ""; - let timeoutRef; - const timeoutPromise = new Promise((resolve, reject) => { - timeoutRef = setTimeout(() => { - reject( - new Error(`Timed out waiting for file ${path} (${currentAction}))`) - ); - }, timeout || 60000); - }); - const elements = []; - let current = path; - while (true) { - elements.push(current); - const parent = dirname(current); - if (parent === current) { - break; - } - current = parent; - } - elements.reverse(); - try { - for (const path of elements) { - const checkAccess = () => - access(path, constants.F_OK) - .then(() => true) - .catch(() => false); - if (!(await checkAccess())) { - let resolveCheckAgain = () => {}; - const watcher = watch(dirname(path), () => { - resolveCheckAgain(); - }); - currentAction = `waiting for ${path}`; - let checkAgainPromise = new Promise((resolve) => { - resolveCheckAgain = resolve; - }); - try { - do { - await Promise.race([timeoutPromise, checkAgainPromise]); - checkAgainPromise = new Promise((resolve) => { - resolveCheckAgain = resolve; - }); - } while (!(await checkAccess())); - } finally { - watcher.close(); - } - } - } - } finally { - clearTimeout(timeoutRef); - } -} diff --git a/turbopack/packages/devlow-bench/src/interfaces/console.ts b/turbopack/packages/devlow-bench/src/interfaces/console.ts index 4841b634d36d9..65210e94cef76 100644 --- a/turbopack/packages/devlow-bench/src/interfaces/console.ts +++ b/turbopack/packages/devlow-bench/src/interfaces/console.ts @@ -1,5 +1,4 @@ -import { Interface, Scenario, ScenarioVariant } from "../index.js"; -import inquirer from "inquirer"; +import { Interface } from "../index.js"; import { bgCyan, bold, magenta, red, underline } from "picocolors"; import { formatUnit } from "../units.js"; import { formatVariant } from "../utils.js"; diff --git a/turbopack/packages/devlow-bench/src/interfaces/interactive.ts b/turbopack/packages/devlow-bench/src/interfaces/interactive.ts index d173cb9bed86a..148bc130675cd 100644 --- a/turbopack/packages/devlow-bench/src/interfaces/interactive.ts +++ b/turbopack/packages/devlow-bench/src/interfaces/interactive.ts @@ -1,6 +1,5 @@ -import { Interface, Scenario, ScenarioVariant } from "../index.js"; +import { Interface } from "../index.js"; import inquirer from "inquirer"; -import { formatUnit } from "../units.js"; import { formatVariant } from "../utils.js"; export default function createInterface(): Interface { diff --git a/turbopack/packages/devlow-bench/src/interfaces/json.ts b/turbopack/packages/devlow-bench/src/interfaces/json.ts index 5b3b22de43e37..970d5c44d4805 100644 --- a/turbopack/packages/devlow-bench/src/interfaces/json.ts +++ b/turbopack/packages/devlow-bench/src/interfaces/json.ts @@ -1,7 +1,5 @@ -import { Interface, Scenario, ScenarioVariant } from "../index.js"; -import inquirer from "inquirer"; +import { Interface } from "../index.js"; import { formatUnit } from "../units.js"; -import { formatVariant } from "../utils.js"; import { writeFile } from "fs/promises"; function filterProp( diff --git a/turbopack/packages/devlow-bench/src/utils.ts b/turbopack/packages/devlow-bench/src/utils.ts index 6fe0e543b637b..2f799c88553ce 100644 --- a/turbopack/packages/devlow-bench/src/utils.ts +++ b/turbopack/packages/devlow-bench/src/utils.ts @@ -1,5 +1,3 @@ -import { ScenarioVariant } from "./index.js"; - export function formatVariant( scenario: string, props: Record