diff --git a/.eslintrc.js b/.eslintrc.js index d0aa8955351e5e..e504e085eb387f 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}`); - } catch (err) { + } catch { return require.resolve( `./tools/node_modules/eslint/node_modules/${request}`); } @@ -212,7 +212,7 @@ module.exports = { 'no-unsafe-finally': 'error', 'no-unsafe-negation': 'error', 'no-unused-labels': 'error', - 'no-unused-vars': ['error', { args: 'none' }], + 'no-unused-vars': ['error', { args: 'none', caughtErrors: 'all' }], 'no-use-before-define': ['error', { classes: true, functions: false, diff --git a/lib/buffer.js b/lib/buffer.js index 645ba7af9bc3fe..8f919a52f1d377 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -42,7 +42,7 @@ const { let isAnyArrayBuffer; try { isAnyArrayBuffer = internalBinding('types').isAnyArrayBuffer; -} catch (e) { +} catch { isAnyArrayBuffer = require('util').types.isAnyArrayBuffer; } const { diff --git a/lib/stream.js b/lib/stream.js index 7c235108c07256..967b6c01cba72d 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -51,7 +51,7 @@ try { // returns undefined for Node < 7.4.0. Stream._isUint8Array = process.binding('util').isUint8Array; } -} catch (e) { +} catch (e) { // eslint-disable-line no-unused-vars } if (!Stream._isUint8Array) { @@ -71,7 +71,7 @@ if (version[0] === 0 && version[1] < 12) { chunk.byteOffset, chunk.byteLength); }; - } catch (e) { + } catch (e) { // eslint-disable-line no-unused-vars } if (!Stream._uint8ArrayToBuffer) {