From 00208b83f4cd6321902365560f0dbe4bcfcc8f1f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 13 Feb 2022 22:13:44 +0100 Subject: [PATCH] cli: add duration in repo lint output Signed-off-by: Patrik Oldsberg --- packages/cli/src/commands/repo/lint.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/repo/lint.ts b/packages/cli/src/commands/repo/lint.ts index 1cd0f1ce63..b054dabe34 100644 --- a/packages/cli/src/commands/repo/lint.ts +++ b/packages/cli/src/commands/repo/lint.ts @@ -71,6 +71,7 @@ export async function command(cmd: Command): Promise { // since some lint rules don't respect the cwd of ESLint process.cwd = () => fullDir; + const start = Date.now(); const eslint = new ESLint({ cwd: fullDir, fix, @@ -81,7 +82,8 @@ export async function command(cmd: Command): Promise { const results = await eslint.lintFiles(['.']); const count = String(results.length).padStart(3); - console.log(`Checked ${count} files in ${relativeDir}`); + const time = ((Date.now() - start) / 1000).toFixed(2); + console.log(`Checked ${count} files in ${relativeDir} ${time}s`); if (fix) { await ESLint.outputFixes(results);