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 danielleadams committed Feb 1, 2022
1 parent 1523aa5 commit d51e8ff
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 d51e8ff

Please sign in to comment.