diff --git a/.eslintrc.js b/.eslintrc.js index cd5fc51e8e3..58f131c1b6f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -130,6 +130,7 @@ module.exports = { // http://eslint.org/docs/rules/#variables 'no-delete-var': 'error', 'no-undef': 'error', + 'no-undef-init': 'error', 'no-unused-vars': ['error', { args: 'none' }], 'no-use-before-define': ['error', { classes: true, diff --git a/lib/internal/util.js b/lib/internal/util.js index 630cd0ef213..5cec64ca18b 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -228,8 +228,8 @@ function getSystemErrorName(err) { // getConstructorOf is wrapped into this to save iterations function getIdentificationOf(obj) { const original = obj; - let constructor = undefined; - let tag = undefined; + let constructor; + let tag; while (obj) { if (constructor === undefined) { diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index dae9c7dc9ea..5b57287a642 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -88,7 +88,7 @@ function testIt(atime, mtime, callback) { expect_errno('futimesSync', fd, ex, 'ENOSYS'); } - let err = undefined; + let err; try { fs.utimesSync('foobarbaz', atime, mtime); } catch (ex) {