Skip to content

Commit 3abd87d

Browse files
BridgeARMayaLekova
authored andcommitted
tools: enable eslint no-undef-init rule
This also fixes the three entries that did not pass. PR-URL: nodejs#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>
1 parent 40f8c59 commit 3abd87d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ module.exports = {
130130
// http://eslint.org/docs/rules/#variables
131131
'no-delete-var': 'error',
132132
'no-undef': 'error',
133+
'no-undef-init': 'error',
133134
'no-unused-vars': ['error', { args: 'none' }],
134135
'no-use-before-define': ['error', {
135136
classes: true,

lib/internal/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ function getSystemErrorName(err) {
228228
// getConstructorOf is wrapped into this to save iterations
229229
function getIdentificationOf(obj) {
230230
const original = obj;
231-
let constructor = undefined;
232-
let tag = undefined;
231+
let constructor;
232+
let tag;
233233

234234
while (obj) {
235235
if (constructor === undefined) {

test/parallel/test-fs-utimes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function testIt(atime, mtime, callback) {
8888
expect_errno('futimesSync', fd, ex, 'ENOSYS');
8989
}
9090

91-
let err = undefined;
91+
let err;
9292
try {
9393
fs.utimesSync('foobarbaz', atime, mtime);
9494
} catch (ex) {

0 commit comments

Comments
 (0)