Merge pull request #2436 from matrix-org/dbkr/lint_autocompleter
De-lint a few more files
This commit is contained in:
commit
702c881008
4 changed files with 8 additions and 7 deletions
|
@ -1,8 +1,5 @@
|
||||||
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
|
# autogenerated file: run scripts/generate-eslint-error-ignore-file to update.
|
||||||
|
|
||||||
src/autocomplete/AutocompleteProvider.js
|
|
||||||
src/autocomplete/Autocompleter.js
|
|
||||||
src/autocomplete/UserProvider.js
|
|
||||||
src/component-index.js
|
src/component-index.js
|
||||||
src/components/structures/BottomLeftMenu.js
|
src/components/structures/BottomLeftMenu.js
|
||||||
src/components/structures/CompatibilityPage.js
|
src/components/structures/CompatibilityPage.js
|
||||||
|
|
|
@ -41,8 +41,12 @@ export default class AutocompleteProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Of the matched commands in the query, returns the first that contains or is contained by the selection, or null.
|
* Of the matched commands in the query, returns the first that contains or is contained by the selection, or null.
|
||||||
|
* @param {string} query The query string
|
||||||
|
* @param {SelectionRange} selection Selection to search
|
||||||
|
* @param {boolean} force True if the user is forcing completion
|
||||||
|
* @return {object} { command, range } where both objects fields are null if no match
|
||||||
*/
|
*/
|
||||||
getCurrentCommand(query: string, selection: SelectionRange, force: boolean = false): ?string {
|
getCurrentCommand(query: string, selection: SelectionRange, force: boolean = false) {
|
||||||
let commandRegex = this.commandRegex;
|
let commandRegex = this.commandRegex;
|
||||||
|
|
||||||
if (force && this.shouldForceComplete()) {
|
if (force && this.shouldForceComplete()) {
|
||||||
|
|
|
@ -60,8 +60,8 @@ const PROVIDER_COMPLETION_TIMEOUT = 3000;
|
||||||
export default class Autocompleter {
|
export default class Autocompleter {
|
||||||
constructor(room: Room) {
|
constructor(room: Room) {
|
||||||
this.room = room;
|
this.room = room;
|
||||||
this.providers = PROVIDERS.map((p) => {
|
this.providers = PROVIDERS.map((Prov) => {
|
||||||
return new p(room);
|
return new Prov(room);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default class UserProvider extends AutocompleteProvider {
|
||||||
users: Array<RoomMember> = null;
|
users: Array<RoomMember> = null;
|
||||||
room: Room = null;
|
room: Room = null;
|
||||||
|
|
||||||
constructor(room) {
|
constructor(room: Room) {
|
||||||
super(USER_REGEX, FORCED_USER_REGEX);
|
super(USER_REGEX, FORCED_USER_REGEX);
|
||||||
this.room = room;
|
this.room = room;
|
||||||
this.matcher = new QueryMatcher([], {
|
this.matcher = new QueryMatcher([], {
|
||||||
|
|
Loading…
Reference in a new issue