diff --git a/.eslintrc.js b/.eslintrc.js index fd77e6c5e..18b502d7f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,9 @@ module.exports = { plugins: ["matrix-org", "import", "jsdoc"], extends: ["plugin:matrix-org/babel", "plugin:import/typescript"], + parserOptions: { + project: ["./tsconfig.json"], + }, env: { browser: true, node: true, diff --git a/package.json b/package.json index 0a8d7438f..9ec8c63cd 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "eslint-import-resolver-typescript": "^3.5.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jsdoc": "^39.6.4", - "eslint-plugin-matrix-org": "^0.9.0", + "eslint-plugin-matrix-org": "^0.10.0", "eslint-plugin-tsdoc": "^0.2.17", "eslint-plugin-unicorn": "^45.0.0", "exorcist": "^2.0.0", diff --git a/src/crypto/algorithms/megolm.ts b/src/crypto/algorithms/megolm.ts index ff7e29264..3037dec13 100644 --- a/src/crypto/algorithms/megolm.ts +++ b/src/crypto/algorithms/megolm.ts @@ -1344,7 +1344,7 @@ export class MegolmDecryption extends DecryptionAlgorithm { errorCode = "OLM_UNKNOWN_MESSAGE_INDEX"; } - throw new DecryptionError(errorCode, e ? e.toString() : "Unknown Error: Error is undefined", { + throw new DecryptionError(errorCode, e instanceof Error ? e.message : "Unknown Error: Error is undefined", { session: content.sender_key + "|" + content.session_id, }); } @@ -1367,7 +1367,8 @@ export class MegolmDecryption extends DecryptionAlgorithm { if (problem) { this.prefixedLogger.info( `When handling UISI from ${event.getSender()} (sender key ${content.sender_key}): ` + - `recent session problem with that sender: ${problem}`, + `recent session problem with that sender:`, + problem, ); let problemDescription = PROBLEM_DESCRIPTIONS[problem.type as "no_olm"] || PROBLEM_DESCRIPTIONS.unknown; if (problem.fixed) { diff --git a/src/crypto/index.ts b/src/crypto/index.ts index 58ac18d06..64e7d607c 100644 --- a/src/crypto/index.ts +++ b/src/crypto/index.ts @@ -1202,6 +1202,7 @@ export class Crypto extends TypedEventEmitter): Promise { if (!(key instanceof Uint8Array)) { + // eslint-disable-next-line @typescript-eslint/no-base-to-string throw new Error(`storeSessionBackupPrivateKey expects Uint8Array, got ${key}`); } const pickleKey = Buffer.from(this.olmDevice.pickleKey); diff --git a/yarn.lock b/yarn.lock index c4d8980e2..4da6b5d03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3385,10 +3385,10 @@ eslint-plugin-jsdoc@^39.6.4: semver "^7.3.8" spdx-expression-parse "^3.0.1" -eslint-plugin-matrix-org@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.9.0.tgz#b2a5186052ddbfa7dc9878779bafa5d68681c7b4" - integrity sha512-+j6JuMnFH421Z2vOxc+0YMt5Su5vD76RSatviy3zHBaZpgd+sOeAWoCLBHD5E7mMz5oKae3Y3wewCt9LRzq2Nw== +eslint-plugin-matrix-org@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.10.0.tgz#8d0998641a4d276343cae2abf253a01bb4d4cc60" + integrity sha512-L7ail0x1yUlF006kn4mHc+OT8/aYZI++i852YXPHxCbM1EY7jeg/fYAQ8tCx5+x08LyqXeS7inAVSL784m0C6Q== eslint-plugin-tsdoc@^0.2.17: version "0.2.17"