Skip to content

Commit 2bef949

Browse files
committed
chore(scripts): improve lint progress output and formatting
- Use logger.stdout.progress() for spinner output - Add clearLine() before success messages - Add blank line for better formatting in validate-no-cdn-refs.mjs
1 parent 8806949 commit 2bef949

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

scripts/lint.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async function runLintOnFiles(files, options = {}) {
160160
}
161161

162162
if (!quiet) {
163-
logger.progress(`Linting ${files.length} file(s)`)
163+
logger.stdout.progress(`Linting ${files.length} file(s)`)
164164
}
165165

166166
// Build the linter configurations.
@@ -227,6 +227,7 @@ async function runLintOnFiles(files, options = {}) {
227227
}
228228

229229
if (!quiet) {
230+
logger.stdout.clearLine()
230231
logger.log(`${colors.green('✓')} Linting passed`)
231232
// Add newline after message (use error to write to same stream)
232233
logger.error('')
@@ -242,7 +243,7 @@ async function runLintOnAll(options = {}) {
242243
const { fix = false, quiet = false } = options
243244

244245
if (!quiet) {
245-
logger.progress('Linting all files')
246+
logger.stdout.progress('Linting all files')
246247
}
247248

248249
const linters = [
@@ -301,6 +302,7 @@ async function runLintOnAll(options = {}) {
301302
}
302303

303304
if (!quiet) {
305+
logger.stdout.clearLine()
304306
logger.log(`${colors.green('✓')} Linting passed`)
305307
// Add newline after message (use error to write to same stream)
306308
logger.error('')

scripts/validate-no-cdn-refs.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import { promises as fs } from 'node:fs'
1717
import path from 'node:path'
1818
import { fileURLToPath } from 'node:url'
19+
1920
import loggerPkg from '@socketsecurity/lib/logger'
2021

2122
const logger = loggerPkg.getDefaultLogger()

0 commit comments

Comments
 (0)