Merge pull request #1714 from matrix-org/jryans/babel-config
Apply new Babel linting config
This commit is contained in:
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {logger} from '../logger';
|
||||
import { logger } from '../logger';
|
||||
|
||||
/**
|
||||
* Internal module. Management of outgoing room key requests.
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ limitations under the License.
|
||||
|
||||
import * as matrixcs from "./matrix";
|
||||
import * as utils from "./utils";
|
||||
import { logger } from './logger';
|
||||
import request from "request";
|
||||
|
||||
matrixcs.request(request);
|
||||
@@ -25,7 +26,7 @@ try {
|
||||
const crypto = require('crypto');
|
||||
utils.setCrypto(crypto);
|
||||
} catch (err) {
|
||||
console.log('nodejs was compiled without crypto support');
|
||||
logger.log('nodejs was compiled without crypto support');
|
||||
}
|
||||
|
||||
export * from "./matrix";
|
||||
|
||||
+2
-2
@@ -36,11 +36,11 @@ const DEFAULT_NAMESPACE = "matrix";
|
||||
// when logging so we always get the current value of console methods.
|
||||
log.methodFactory = function(methodName, logLevel, loggerName) {
|
||||
return function(...args) {
|
||||
/* eslint-disable @babel/no-invalid-this */
|
||||
/* eslint-disable @typescript-eslint/no-invalid-this */
|
||||
if (this.prefix) {
|
||||
args.unshift(this.prefix);
|
||||
}
|
||||
/* eslint-enable @babel/no-invalid-this */
|
||||
/* eslint-enable @typescript-eslint/no-invalid-this */
|
||||
const supportedByConsole = methodName === "error" ||
|
||||
methodName === "warn" ||
|
||||
methodName === "trace" ||
|
||||
|
||||
+12
-21
@@ -20,17 +20,17 @@ limitations under the License.
|
||||
* @module models/room
|
||||
*/
|
||||
|
||||
import {EventEmitter} from "events";
|
||||
import {EventTimelineSet} from "./event-timeline-set";
|
||||
import {EventTimeline} from "./event-timeline";
|
||||
import {getHttpUriForMxc} from "../content-repo";
|
||||
import { EventEmitter } from "events";
|
||||
import { EventTimelineSet } from "./event-timeline-set";
|
||||
import { EventTimeline } from "./event-timeline";
|
||||
import { getHttpUriForMxc } from "../content-repo";
|
||||
import * as utils from "../utils";
|
||||
import {EventStatus, MatrixEvent} from "./event";
|
||||
import {RoomMember} from "./room-member";
|
||||
import {RoomSummary} from "./room-summary";
|
||||
import {logger} from '../logger';
|
||||
import {ReEmitter} from '../ReEmitter';
|
||||
import {EventType, RoomCreateTypeField, RoomType} from "../@types/event";
|
||||
import { EventStatus, MatrixEvent } from "./event";
|
||||
import { RoomMember } from "./room-member";
|
||||
import { RoomSummary } from "./room-summary";
|
||||
import { logger } from '../logger';
|
||||
import { ReEmitter } from '../ReEmitter';
|
||||
import { EventType, RoomCreateTypeField, RoomType } from "../@types/event";
|
||||
import { normalize } from "../utils";
|
||||
|
||||
// These constants are used as sane defaults when the homeserver doesn't support
|
||||
@@ -59,7 +59,6 @@ function synthesizeReceipt(userId, event, receiptType) {
|
||||
return new MatrixEvent(fakeReceipt);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new Room.
|
||||
*
|
||||
@@ -234,7 +233,6 @@ function pendingEventsKey(roomId) {
|
||||
|
||||
utils.inherits(Room, EventEmitter);
|
||||
|
||||
|
||||
/**
|
||||
* Bulk decrypt critical events in a room
|
||||
*
|
||||
@@ -495,7 +493,6 @@ Room.prototype.getLiveTimeline = function() {
|
||||
return this.getUnfilteredTimelineSet().getLiveTimeline();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the timestamp of the last message in the room
|
||||
*
|
||||
@@ -634,13 +631,12 @@ Room.prototype._loadMembersFromServer = async function() {
|
||||
at: lastSyncToken,
|
||||
});
|
||||
const path = utils.encodeUri("/rooms/$roomId/members?" + queryString,
|
||||
{$roomId: this.roomId});
|
||||
{ $roomId: this.roomId });
|
||||
const http = this._client._http;
|
||||
const response = await http.authedRequest(undefined, "GET", path);
|
||||
return response.chunk;
|
||||
};
|
||||
|
||||
|
||||
Room.prototype._loadMembers = async function() {
|
||||
// were the members loaded from the server?
|
||||
let fromServer = false;
|
||||
@@ -653,7 +649,7 @@ Room.prototype._loadMembers = async function() {
|
||||
`members from server for room ${this.roomId}`);
|
||||
}
|
||||
const memberEvents = rawMembersEvents.map(this._client.getEventMapper());
|
||||
return {memberEvents, fromServer};
|
||||
return { memberEvents, fromServer };
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1125,7 +1121,6 @@ Room.prototype.getInvitedAndJoinedMemberCount = function() {
|
||||
return calculateRoomName(this, userId, true);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Check if the given user_id has the given membership state.
|
||||
* @param {string} userId The user ID to check.
|
||||
@@ -1282,7 +1277,6 @@ Room.prototype._addLiveEvent = function(event, duplicateStrategy, fromCache) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add a pending outgoing event to this room.
|
||||
*
|
||||
@@ -1693,7 +1687,6 @@ Room.prototype.removeEvent = function(eventId) {
|
||||
return removedAny;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Recalculate various aspects of the room, including the room name and
|
||||
* room summary. Call this any time the room's current state is modified.
|
||||
@@ -1918,7 +1911,6 @@ Room.prototype._buildReceiptCache = function(receipts) {
|
||||
return receiptCacheByEventId;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Add a temporary local-echo receipt to the room to reflect in the
|
||||
* client the fact that we've sent one.
|
||||
@@ -1976,7 +1968,6 @@ Room.prototype.getAccountData = function(type) {
|
||||
return this.accountData[type];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether the syncing user has permission to send a message in the room
|
||||
* @return {boolean} true if the user should be permitted to send
|
||||
|
||||
@@ -19,7 +19,7 @@ limitations under the License.
|
||||
* @module models/search-result
|
||||
*/
|
||||
|
||||
import {EventContext} from "./event-context";
|
||||
import { EventContext } from "./event-context";
|
||||
|
||||
/**
|
||||
* Construct a new SearchResult
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ limitations under the License.
|
||||
* @module store/memory
|
||||
*/
|
||||
|
||||
import {User} from "../models/user";
|
||||
import { User } from "../models/user";
|
||||
|
||||
function isValidFilterId(filterId) {
|
||||
const isValidStr = typeof filterId === "string" &&
|
||||
|
||||
Reference in New Issue
Block a user