diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-11-30 19:35:55 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-03 14:48:06 +0300 |
commit | 5f18991f270754a3dca7f64ba56afe10fbb7627c (patch) | |
tree | 721d3664c33f0f13d7d1a01a05ffdbb79a5ce838 /.eslintrc.js | |
parent | 2b5f2bc68b67621b42f6a698792532d1149e6196 (diff) |
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: https://github.com/nodejs/node/pull/24753
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 0b4c170813d..23ddc3c95cd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,7 +17,10 @@ Module._findPath = (request, paths, isMain) => { if (!r && hacks.includes(request)) { try { return require.resolve(`./tools/node_modules/${request}`); - } catch { + // 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) { return require.resolve( `./tools/node_modules/eslint/node_modules/${request}`); } |