Skip to content

Commit

Permalink
Merge pull request #1798 from matrix-org/t3chguy/eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Jul 21, 2021
2 parents fb315ac + 0c06e47 commit a878588
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"gendoc": "jsdoc -c jsdoc.json -P package.json",
"lint": "yarn lint:types && yarn lint:js",
"lint:js": "eslint --max-warnings 57 src spec",
"lint:js-fix": "eslint --fix src spec",
"lint:types": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4426,7 +4426,7 @@ export class MatrixClient extends EventEmitter {
* @return {Promise} Resolves: to nothing
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
public _unstable_setStatusMessage(newMessage: string): Promise<void> { // eslint-disable-line camelcase
public _unstable_setStatusMessage(newMessage: string): Promise<void> { // eslint-disable-line
const type = "im.vector.user_status";
return Promise.all(this.getRooms().map(async (room) => {
const isJoined = room.getMyMembership() === "join";
Expand Down Expand Up @@ -5732,7 +5732,7 @@ export class MatrixClient extends EventEmitter {
* @return {Promise<string[]>} Resolves to a set of rooms
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
public async _unstable_getSharedRooms(userId: string): Promise<string[]> { // eslint-disable-line camelcase
public async _unstable_getSharedRooms(userId: string): Promise<string[]> { // eslint-disable-line
if (!(await this.doesServerSupportUnstableFeature("uk.half-shot.msc2666"))) {
throw Error('Server does not support shared_rooms API');
}
Expand Down
2 changes: 1 addition & 1 deletion src/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class User extends EventEmitter {
* @param {MatrixEvent} event The <code>im.vector.user_status</code> event.
* @fires module:client~MatrixClient#event:"User.unstable_statusMessage"
*/
// eslint-disable-next-line camelcase
// eslint-disable-next-line
public unstable_updateStatusMessage(event: MatrixEvent): void {
if (!event.getContent()) this.unstable_statusMessage = "";
else this.unstable_statusMessage = event.getContent()["status"];
Expand Down
10 changes: 5 additions & 5 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,12 @@ export class SyncApi {
// Now wait for the saved sync to finish...
debuglog("Waiting for saved sync before starting sync processing...");
await savedSyncPromise;
this._sync({ filterId });
this.doSync({ filterId });
};

if (client.isGuest()) {
// no push rules for guests, no access to POST filter for guests.
this._sync({});
this.doSync({});
} else {
// Pull the saved sync token out first, before the worker starts sending
// all the sync data which could take a while. This will let us send our
Expand Down Expand Up @@ -753,7 +753,7 @@ export class SyncApi {
* @param {string} syncOptions.filterId
* @param {boolean} syncOptions.hasSyncedBefore
*/
private async _sync(syncOptions: ISyncOptions): Promise<void> {
private async doSync(syncOptions: ISyncOptions): Promise<void> {
const client = this.client;

if (!this.running) {
Expand Down Expand Up @@ -850,7 +850,7 @@ export class SyncApi {
}

// Begin next sync
this._sync(syncOptions);
this.doSync(syncOptions);
}

private doSyncRequest(syncOptions: ISyncOptions, syncToken: string): IRequestPromise<ISyncResponse> {
Expand Down Expand Up @@ -955,7 +955,7 @@ export class SyncApi {
catchingUp: true,
});
}
this._sync(syncOptions);
this.doSync(syncOptions);
});

this.currentSyncRequest = null;
Expand Down
8 changes: 4 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ export function isFunction(value: any) {
* @throws If the object is missing keys.
*/
// note using 'keys' here would shadow the 'keys' function defined above
export function checkObjectHasKeys(obj: object, keys_: string[]) {
for (let i = 0; i < keys_.length; i++) {
if (!obj.hasOwnProperty(keys_[i])) {
throw new Error("Missing required key: " + keys_[i]);
export function checkObjectHasKeys(obj: object, keys: string[]) {
for (let i = 0; i < keys.length; i++) {
if (!obj.hasOwnProperty(keys[i])) {
throw new Error("Missing required key: " + keys[i]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2858,7 +2858,7 @@ eslint-config-google@^0.14.0:

"eslint-plugin-matrix-org@github:matrix-org/eslint-plugin-matrix-org#main":
version "0.3.2"
resolved "https://codeload.github.com/matrix-org/eslint-plugin-matrix-org/tar.gz/383a1e4a9ef7944c921efda0de2ac9635d45cb5c"
resolved "https://codeload.github.com/matrix-org/eslint-plugin-matrix-org/tar.gz/8529f1d77863db6327cf1a1a4fa65d06cc26f91b"

eslint-rule-composer@^0.3.0:
version "0.3.0"
Expand Down

0 comments on commit a878588

Please sign in to comment.