tools: enable eslint no-undef-init rule

This also fixes the three entries that did not pass.

PR-URL: https://github.com/nodejs/node/pull/18831
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Ruben Bridgewater 2018-02-17 03:45:07 +01:00
parent a926c1a18f
commit ff5b56ea9d
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
3 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

@ -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) {

View File

@ -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) {