Skip to content

Commit

Permalink
tools: remove exception for Node.js 8 and earlier
Browse files Browse the repository at this point in the history
Remove exception in .eslintrc.js to accommodate versions of Node.js
prior to 10.x. 10.x and later all support omitting catch block
arguments.

PR-URL: #38840
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
Trott authored and danielleadams committed Jun 1, 2021
1 parent 6986154 commit be8d934
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ Module._findPath = (request, paths, isMain) => {
if (!r && hacks.includes(request)) {
try {
return require.resolve(`./tools/node_modules/${request}`);
// Keep the variable in place to ensure that ESLint started by older Node.js
// versions work as expected.
// eslint-disable-next-line no-unused-vars
} catch (e) {
} catch {
return require.resolve(
`./tools/node_modules/eslint/node_modules/${request}`);
}
Expand Down

0 comments on commit be8d934

Please sign in to comment.