tslint Error – Shadowed name: ‘err’

You are using the same variable “err” in both outer and inner callbacks, which is prevented by tslint.

If you want to use the same variable then “no-shadowed-variable”: false, otherwise do as below.

fs.readdir(fileUrl, (readDirError, files) => {
    fs.readFile(path.join(fileUrl, files[0]), function (err, data) {
            if (!err) {
                res.send(data);
            }
        });
    });

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)