Skip to content

Commit 09cd2ec

Browse files
committed
tools: fix eslint usage for Node.js 8 and before
IDEs like vscode use older Node.js versions that do not yet support the new try catch syntax. This makes sure eslint continues to work in these IDEs as before. PR-URL: #24753 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 807c108 commit 09cd2ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.eslintrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ Module._findPath = (request, paths, isMain) => {
1717
if (!r && hacks.includes(request)) {
1818
try {
1919
return require.resolve(`./tools/node_modules/${request}`);
20-
} catch {
20+
// Keep the variable in place to ensure that ESLint started by older Node.js
21+
// versions work as expected.
22+
// eslint-disable-next-line no-unused-vars
23+
} catch (e) {
2124
return require.resolve(
2225
`./tools/node_modules/eslint/node_modules/${request}`);
2326
}

0 commit comments

Comments
 (0)