From d34b411e76ee9071cf82dc337f705085133b76c9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 20 Dec 2021 21:31:05 -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. --- 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);