Skip to content

Commit

Permalink
tools: use arrow function for callback in lint-sh.js
Browse files Browse the repository at this point in the history
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: #41256
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and targos committed Jan 14, 2022
1 parent e2df381 commit 62e28f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/lint-sh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 62e28f1

Please sign in to comment.