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:
parent
a926c1a18f
commit
ff5b56ea9d
@ -130,6 +130,7 @@ module.exports = {
|
|||||||
// http://eslint.org/docs/rules/#variables
|
// http://eslint.org/docs/rules/#variables
|
||||||
'no-delete-var': 'error',
|
'no-delete-var': 'error',
|
||||||
'no-undef': 'error',
|
'no-undef': 'error',
|
||||||
|
'no-undef-init': 'error',
|
||||||
'no-unused-vars': ['error', { args: 'none' }],
|
'no-unused-vars': ['error', { args: 'none' }],
|
||||||
'no-use-before-define': ['error', {
|
'no-use-before-define': ['error', {
|
||||||
classes: true,
|
classes: true,
|
||||||
|
@ -228,8 +228,8 @@ function getSystemErrorName(err) {
|
|||||||
// getConstructorOf is wrapped into this to save iterations
|
// getConstructorOf is wrapped into this to save iterations
|
||||||
function getIdentificationOf(obj) {
|
function getIdentificationOf(obj) {
|
||||||
const original = obj;
|
const original = obj;
|
||||||
let constructor = undefined;
|
let constructor;
|
||||||
let tag = undefined;
|
let tag;
|
||||||
|
|
||||||
while (obj) {
|
while (obj) {
|
||||||
if (constructor === undefined) {
|
if (constructor === undefined) {
|
||||||
|
@ -88,7 +88,7 @@ function testIt(atime, mtime, callback) {
|
|||||||
expect_errno('futimesSync', fd, ex, 'ENOSYS');
|
expect_errno('futimesSync', fd, ex, 'ENOSYS');
|
||||||
}
|
}
|
||||||
|
|
||||||
let err = undefined;
|
let err;
|
||||||
try {
|
try {
|
||||||
fs.utimesSync('foobarbaz', atime, mtime);
|
fs.utimesSync('foobarbaz', atime, mtime);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user