Skip to content

Commit

Permalink
tools: enable eslint no-undef-init rule
Browse files Browse the repository at this point in the history
This also fixes the three entries that did not pass.

PR-URL: nodejs#18831
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
BridgeAR committed Feb 22, 2018
1 parent a926c1a commit ff5b56e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-utimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ff5b56e

Please sign in to comment.