From 5c57b9ab9b3fdc35148549498e89f6dcb6cd3522 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 20 Apr 2020 19:04:55 +0100 Subject: [PATCH] delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/autocomplete/AutocompleteProvider.tsx | 4 ++-- src/autocomplete/CommunityProvider.tsx | 2 +- src/autocomplete/UserProvider.tsx | 4 ++-- src/components/views/rooms/Autocomplete.tsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/autocomplete/AutocompleteProvider.tsx b/src/autocomplete/AutocompleteProvider.tsx index 7efe823250..3749d9bb2c 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -64,14 +64,14 @@ export default class AutocompleteProvider { commandRegex = this.forcedCommandRegex || /\S+/g; } - if (commandRegex == null) { + if (commandRegex === null) { return null; } commandRegex.lastIndex = 0; let match; - while ((match = commandRegex.exec(query)) != null) { + while ((match = commandRegex.exec(query)) !== null) { const start = match.index; const end = start + match[0].length; if (selection.start <= end && selection.end >= start) { diff --git a/src/autocomplete/CommunityProvider.tsx b/src/autocomplete/CommunityProvider.tsx index f1a5c0f2ca..18ec125cb1 100644 --- a/src/autocomplete/CommunityProvider.tsx +++ b/src/autocomplete/CommunityProvider.tsx @@ -49,7 +49,7 @@ export default class CommunityProvider extends AutocompleteProvider { }); } - async getCompletions(query: string, selection: ISelectionRange, force: boolean = false): Promise { + async getCompletions(query: string, selection: ISelectionRange, force = false): Promise { const BaseAvatar = sdk.getComponent('views.avatars.BaseAvatar'); // Disable autocompletions when composing commands because of various issues diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index 35ea53f6c0..0500329ec7 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -98,14 +98,14 @@ export default class UserProvider extends AutocompleteProvider { this.users = null; }; - async getCompletions(query: string, selection: ISelectionRange, force = false): Promise { + async getCompletions(rawQuery: string, selection: ISelectionRange, force = false): Promise { const MemberAvatar = sdk.getComponent('views.avatars.MemberAvatar'); // lazy-load user list into matcher if (this.users === null) this._makeUsers(); let completions = []; - const {command, range} = this.getCurrentCommand(query, selection, force); + const {command, range} = this.getCurrentCommand(rawQuery, selection, force); if (!command) return completions; diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 68d82f0bc3..3a2d5272f8 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -281,7 +281,7 @@ export default class Autocomplete extends React.PureComponent { render() { let position = 1; const renderedCompletions = this.state.completions.map((completionResult, i) => { - const completions = completionResult.completions.map((completion, i) => { + const completions = completionResult.completions.map((completion, j) => { const selected = position === this.state.selectionOffset; const className = classNames('mx_Autocomplete_Completion', {selected}); const componentPosition = position; @@ -292,7 +292,7 @@ export default class Autocomplete extends React.PureComponent { }; return React.cloneElement(completion.component, { - "key": i, + "key": j, "ref": `completion${componentPosition}`, "id": generateCompletionDomId(componentPosition - 1), // 0 index the completion IDs className,