From 957cb846f7811e03a31fabb30663a56a18cc6d0b Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 02:17:41 +0000 Subject: [PATCH] feat: Updated src/index.ts --- src/index.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index d63db8d..a488028 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,11 +44,23 @@ const cSpellContent = { writeFile(`./${projectName}.txt`, ""); writeFile("./cspell.json", JSON.stringify(cSpellContent, null, 2)); -// TODO: Support other file types -const fileTypes = ["md", "ts", "json", "lua"]; +// Import consola +import consola from "consola"; + +// Ask the user for the file types they want to check +const fileTypes = await consola.prompt("Select file types to check.", { + type: "multiselect", + options: [ + { value: "md", label: "Markdown" }, + { value: "ts", label: "TypeScript" }, + { value: "json", label: "JSON" }, + { value: "lua", label: "Lua" }, + ], +}); + const cspellCmd = isInstalled ? "cspell" : "npx cspell"; -// Run cspell on Markdown files to get unknown words +// Run cspell on the selected file types to get unknown words const cmd = `${cspellCmd} --words-only --unique --no-progress --show-context ${fileTypes .map((fileType) => `"**/**/*.${fileType}"`) .join(" ")}`;