From 5212a9c32bfbd1aa38ffdc66dd2bab497e28c0df Mon Sep 17 00:00:00 2001 From: Dirk Wilden Date: Fri, 12 Jul 2024 10:50:24 +0200 Subject: [PATCH] expose eslint --cache flag --- src/cli.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index 8ce93753..a2bd1003 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -37,6 +37,7 @@ export interface Options { no: boolean; logger: Logger; yarn?: boolean; + cache?: boolean; } export type VerbFilesFunction = ( @@ -65,6 +66,7 @@ const cli = meow({ -n, --no Assume a no answer for every prompt. --dry-run Don't make any actual changes. --yarn Use yarn instead of npm. + --cache Only check changed files Examples $ gts init -y @@ -78,6 +80,7 @@ const cli = meow({ no: {type: 'boolean', alias: 'n'}, dryRun: {type: 'boolean'}, yarn: {type: 'boolean'}, + cache: {type: 'boolean'}, }, }); @@ -118,6 +121,7 @@ export async function run(verb: string, files: string[]): Promise { no: cli.flags.no || cli.flags.n || false, logger, yarn: cli.flags.yarn || isYarnUsed(), + cache: cli.flags.cache || false, } as Options; // Linting/formatting depend on typescript. We don't want to load the // typescript module during init, since it might not exist. @@ -137,6 +141,10 @@ export async function run(verb: string, files: string[]): Promise { ); } + if (options.cache) { + flags.push('--cache'); + } + switch (verb) { case 'lint': case 'check': {