Skip to content

Commit

Permalink
Add lint for unused locals (matrix-org#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans authored Mar 9, 2022
1 parent 2ac9448 commit dbd6af7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 36 deletions.
34 changes: 0 additions & 34 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4924,40 +4924,6 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
);
}

/**
* This is an internal method.
* @param {MatrixClient} client
* @param {string} roomId
* @param {string} userId
* @param {string} membershipValue
* @param {string} reason
* @param {module:client.callback} callback Optional.
* @return {Promise} Resolves: TODO
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
private setMembershipState(
roomId: string,
userId: string,
membershipValue: string,
reason?: string,
callback?: Callback,
) {
if (utils.isFunction(reason)) {
callback = reason as any as Callback; // legacy
reason = undefined;
}

const path = utils.encodeUri(
"/rooms/$roomId/state/m.room.member/$userId",
{ $roomId: roomId, $userId: userId },
);

return this.http.authedRequest(callback, Method.Put, path, undefined, {
membership: membershipValue,
reason: reason,
});
}

private membershipChange(
roomId: string,
userId: string,
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/verification/request/VerificationRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class VerificationRequest<

private commonMethods: VerificationMethod[] = [];
private _phase: Phase;
private _cancellingUserId: string;
public _cancellingUserId: string; // Used in tests only
private _verifier: VerificationBase<any, any>;

constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/http-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ export class MatrixError extends Error {
* @constructor
*/
export class ConnectionError extends Error {
constructor(message: string, private readonly cause: Error = undefined) {
constructor(message: string, cause: Error = undefined) {
super(message + (cause ? `: ${cause.message}` : ""));
}

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": false,
"noUnusedLocals": true,
"noEmit": true,
"declaration": true
},
Expand Down

0 comments on commit dbd6af7

Please sign in to comment.