lint: prevent object string concatenation (#23172)

This commit is contained in:
Pavel Feldman 2023-05-19 15:17:43 -07:00 committed by GitHub
parent bd33e5f8c0
commit bd090e67df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 4 deletions

View file

@ -0,0 +1,9 @@
module.exports = {
extends: ".eslintrc.js",
rules: {
"@typescript-eslint/no-base-to-string": "error",
},
parserOptions: {
project: "./tsconfig.json"
},
};

View file

@ -0,0 +1,3 @@
module.exports = {
extends: "../.eslintrc-with-ts-config.js",
};

View file

@ -152,7 +152,7 @@ export class VideoRecorder {
private async _sendFrame(frame: Buffer) {
return new Promise(f => this._process!.stdin!.write(frame, f)).then(error => {
if (error)
this._progress.log(`ffmpeg failed to write: ${error}`);
this._progress.log(`ffmpeg failed to write: ${String(error)}`);
});
}

View file

@ -382,7 +382,7 @@ export abstract class APIRequestContext extends SdkObject {
const emptyStreamTransform = new SafeEmptyStreamTransform(notifyBodyFinished);
body = pipeline(response, emptyStreamTransform, transform, e => {
if (e)
reject(new Error(`failed to decompress '${encoding}' encoding: ${e}`));
reject(new Error(`failed to decompress '${encoding}' encoding: ${e.message}`));
});
body.on('error', e => reject(new Error(`failed to decompress '${encoding}' encoding: ${e}`)));
} else {

View file

@ -0,0 +1,3 @@
module.exports = {
extends: "../.eslintrc-with-ts-config.js",
};

View file

@ -0,0 +1,3 @@
module.exports = {
extends: "../.eslintrc-with-ts-config.js",
};