diff --git a/.eslintrc.js b/.eslintrc.js index 0613121df0..069a67e511 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -40,6 +40,7 @@ module.exports = { "@typescript-eslint/ban-ts-comment": "off", "quotes": "off", + "no-extra-boolean-cast": "off", } }], }; diff --git a/src/indexing/BaseEventIndexManager.ts b/src/indexing/BaseEventIndexManager.ts index 38c1a52e05..fb7222d41b 100644 --- a/src/indexing/BaseEventIndexManager.ts +++ b/src/indexing/BaseEventIndexManager.ts @@ -14,18 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ +// The following interfaces take their names and member names from the js-sdk +/* eslint-disable camelcase */ + export interface MatrixEvent { type: string; sender: string; content: {}; - eventId: string; - originServerTs: number; + event_id: string; + origin_server_ts: number; unsigned?: {}; roomId: string; } export interface MatrixProfile { - avatarUrl: string; + avatar_url: string; displayname: string; } @@ -37,9 +40,9 @@ export interface CrawlerCheckpoint { } export interface ResultContext { - eventsBefore: [MatrixEvent]; - eventsAfter: [MatrixEvent]; - profileInfo: Map; + events_before: [MatrixEvent]; + events_after: [MatrixEvent]; + profile_info: Map; } export interface ResultsElement { @@ -55,11 +58,11 @@ export interface SearchResult { } export interface SearchArgs { - searchTerm: string; - beforeLimit: number; - afterLimit: number; - orderByRecency: boolean; - roomId?: string; + search_term: string; + before_limit: number; + after_limit: number; + order_by_recency: boolean; + room_id?: string; } export interface EventAndProfile { @@ -76,8 +79,8 @@ export interface LoadArgs { export interface IndexStats { size: number; - eventCount: number; - roomCount: number; + event_count: number; + room_count: number; } /** diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 488dc1d1e5..f04f9bb515 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -382,7 +382,7 @@ export class Algorithm extends EventEmitter { if (!this._stickyRoom) { // If there's no sticky room, just do nothing useful. - if (this._cachedStickyRooms) { + if (!!this._cachedStickyRooms) { // Clear the cache if we won't be needing it this._cachedStickyRooms = null; this.emit(LIST_UPDATED_EVENT); diff --git a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts index 4e9959a5ca..e3e0cdcac4 100644 --- a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts @@ -262,8 +262,9 @@ export class ImportanceAlgorithm extends OrderingAlgorithm { if (indices[lastCat] > indices[thisCat]) { // "should never happen" disclaimer goes here - // eslint-disable-next-line max-len - console.warn(`!! Room list index corruption: ${lastCat} (i:${indices[lastCat]}) is greater than ${thisCat} (i:${indices[thisCat]}) - category indices are likely desynced from reality`); + console.warn( + `!! Room list index corruption: ${lastCat} (i:${indices[lastCat]}) is greater ` + + `than ${thisCat} (i:${indices[thisCat]}) - category indices are likely desynced from reality`); // TODO: Regenerate index when this happens: https://github.com/vector-im/riot-web/issues/14234 }