Skip to content

Commit

Permalink
🚨 Fix code lint
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Oct 16, 2024
1 parent fa3cf50 commit 942a150
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 38 deletions.
35 changes: 2 additions & 33 deletions libs/create-qwikdev-astro/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,7 @@
import fs, { cpSync, existsSync, mkdirSync } from "node:fs";
import path, { join } from "node:path";
import process from "node:process";
import {
cancel,
confirm,
intro,
isCancel,
log,
outro,
select,
spinner,
text
} from "@clack/prompts";
import { bgBlue, bgMagenta, bold, cyan, gray, magenta, red } from "kleur/colors";
import yargs from "yargs";
import { app } from "./app";
import { type Adapter, type Config, type UserConfig, defaultConfig } from "./config";
import {
$,
__dirname,
getPackageManager,
installDependencies,
note,
panic,
panicCanceled,
pmRunCommand,
replacePackageJsonRunCommand,
resolveAbsoluteDir,
resolveRelativeDir,
sanitizePackageName,
scanBoolean,
scanString,
updatePackageName
} from "./utils";
import { type UserConfig, defaultConfig } from "./config";
import { __dirname, panic } from "./utils";

export function parseArgs(args: string[]): UserConfig {
const parsedArgs = yargs(args)
Expand Down
10 changes: 5 additions & 5 deletions libs/create-qwikdev-astro/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from "node:fs";
import os from "node:os";
import path, { join, resolve, relative } from "node:path";
import { fileURLToPath } from "node:url";
import { isCancel, log, text } from "@clack/prompts";
import { confirm, isCancel, log, text } from "@clack/prompts";
import { gray, green, red, reset, white } from "kleur/colors";
import detectPackageManager from "which-pm-runs";
import { defaultConfig } from "./config";
Expand Down Expand Up @@ -309,16 +309,16 @@ export async function scanBoolean(

export function ensureString<T extends string>(
input: any,
validate?: (v: string) => v is T,
positional = false
positional = false,
validate?: (v: string) => v is T
): asserts input is T {
ensure(input, validate ?? isString, positional);
}

export function ensureNumber<T extends number>(
input: any,
validate?: (v: number) => v is T,
positional = false
positional = false,
validate?: (v: number) => v is T
): asserts input is T {
ensure(input, validate ?? isNumber, positional);
}
Expand Down

0 comments on commit 942a150

Please sign in to comment.