From be51768abc2255b8bb80c8871c08ff22774a8c1e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 30 Nov 2018 17:35:55 +0100 Subject: [PATCH 1/2] 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. --- .eslintrc.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0b4c170813d0a7..c58161b084c2ca 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}`); } From 540226b22ec551cfcd54818bbf5aee072717ea8a Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 30 Nov 2018 19:40:24 +0100 Subject: [PATCH 2/2] fixup: capitalize ESLint Co-Authored-By: BridgeAR --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index c58161b084c2ca..23ddc3c95cd39d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,7 +17,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 + // 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) {