From f79fe63bf2ae132872e38b6cef26a862f114621c Mon Sep 17 00:00:00 2001 From: WofWca Date: Mon, 14 Apr 2025 19:26:27 +0400 Subject: [PATCH 1/2] refactor: also check .tsx files for `console.log` --- bin/log-conventions.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/log-conventions.js b/bin/log-conventions.js index a08cacaba9..73969432e9 100644 --- a/bin/log-conventions.js +++ b/bin/log-conventions.js @@ -33,7 +33,14 @@ const files = await walk({ let found = 0 for (const file of files) { - if (!file.endsWith('.ts')) { + if ( + !file.endsWith('.ts') && + !file.endsWith('.js') && + !file.endsWith('.mjs') && + !file.endsWith('.mts') && + !file.endsWith('.tsx') && + !file.endsWith('.jsx') + ) { continue } From 633b09a5a38b6fb0526c09f9bcb628bb0b6ba437 Mon Sep 17 00:00:00 2001 From: WofWca Date: Mon, 14 Apr 2025 19:30:14 +0400 Subject: [PATCH 2/2] refactor: also warn about `console.warn` usage --- bin/log-conventions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/log-conventions.js b/bin/log-conventions.js index 73969432e9..33efd2ab1d 100644 --- a/bin/log-conventions.js +++ b/bin/log-conventions.js @@ -54,7 +54,7 @@ for (const file of files) { const lineContainsConsoleLog = line.indexOf('console.') !== -1 && - /console.(debug|log|info|error)\(/.test(line) === true + /console.(debug|log|info|warn|error)\(/.test(line) === true if (!lineContainsConsoleLog) continue