tools: remove exception for Node.js 8 and earlier

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Rich Trott 2021-05-29 08:16:02 -07:00
parent 3457130eb6
commit 0332d31b94

View File

@ -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}`);
}