From 62e28f19f71ad7044666dac92c3820c6db048ae7 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 22 Dec 2021 02:44:09 -0800 Subject: [PATCH] tools: use arrow function for callback in lint-sh.js The function declaration inside an else block is odd (and violates a recommended ESLint rule). We tend to use arrow functions for callbacks anyway, so switch to that. PR-URL: https://github.com/nodejs/node/pull/41256 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- tools/lint-sh.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lint-sh.js b/tools/lint-sh.js index 42889c16b6af0e..378cb38af28744 100755 --- a/tools/lint-sh.js +++ b/tools/lint-sh.js @@ -166,11 +166,11 @@ if ( const entryPoint = resolve(process.argv[2]); const stats = statSync(entryPoint, { throwIfNoEntry: false }); - function onError(e) { + const onError = (e) => { console.log(USAGE_STR); console.error(e); process.exitCode = 1; - } + }; if (stats?.isDirectory()) { SPAWN_OPTIONS.cwd = entryPoint; checkFiles(...findScriptFilesRecursively(entryPoint)).catch(onError);