mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Re-enable no-empty-function
This commit is contained in:
parent
a146306d0b
commit
eac06ae39a
13 changed files with 24 additions and 27 deletions
11
.eslintrc.js
11
.eslintrc.js
|
@ -100,7 +100,7 @@ module.exports = {
|
|||
],
|
||||
"@typescript-eslint/member-ordering": "error",
|
||||
"@typescript-eslint/no-array-constructor": "error",
|
||||
"@typescript-eslint/no-empty-function": "off", //"error",
|
||||
"@typescript-eslint/no-empty-function": "error",
|
||||
"@typescript-eslint/no-empty-interface": "error",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
||||
|
@ -251,5 +251,12 @@ module.exports = {
|
|||
],
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "off"
|
||||
}
|
||||
},
|
||||
// // We ultimately didn't need this but I thought I should document it anyway
|
||||
// "overrides": [{
|
||||
// "files": ["src/completions/*.ts",],
|
||||
// "rules": {
|
||||
// "@typescript-eslint/no-empty-function": "off",
|
||||
// },
|
||||
// }],
|
||||
};
|
||||
|
|
|
@ -4,29 +4,14 @@
|
|||
*/
|
||||
import * as controller from "@src/lib/controller"
|
||||
|
||||
export async function inputStartedListener() {
|
||||
}
|
||||
|
||||
export async function inputChangedListener(
|
||||
currentInput: string,
|
||||
emitSuggestion: (suggestions: browser.omnibox.SuggestResult[]) => void
|
||||
) {
|
||||
}
|
||||
|
||||
export async function inputEnteredListener(
|
||||
input: string, disposition:
|
||||
browser.omnibox.OnInputEnteredDisposition) {
|
||||
controller.acceptExCmd(input)
|
||||
}
|
||||
|
||||
export async function inputCancelledListener() {
|
||||
}
|
||||
|
||||
export async function init() {
|
||||
browser.omnibox.onInputStarted.addListener(inputStartedListener)
|
||||
browser.omnibox.onInputChanged.addListener(inputChangedListener)
|
||||
browser.omnibox.onInputEntered.addListener(inputEnteredListener)
|
||||
browser.omnibox.onInputCancelled.addListener(inputCancelledListener)
|
||||
browser.omnibox.setDefaultSuggestion({
|
||||
description: `Execute a Tridactyl exstr (for example, "tabopen -c container www.google.com")`,
|
||||
})
|
||||
|
|
|
@ -324,7 +324,10 @@ export abstract class CompletionSourceFuse extends CompletionSource {
|
|||
}
|
||||
|
||||
/* abstract onUpdate(query: string, prefix: string, options: CompletionOptionFuse[]) */
|
||||
abstract onInput(exstr: string)
|
||||
|
||||
// Lots of methods don't need this but some do
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
async onInput(exstr: string) {}
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
|
|
@ -144,5 +144,4 @@ export class AproposCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return this.updateDisplay()
|
||||
}
|
||||
|
||||
onInput() {}
|
||||
}
|
||||
|
|
|
@ -144,5 +144,5 @@ export class BindingsCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return this.updateDisplay()
|
||||
}
|
||||
|
||||
onInput() {}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@ export class BmarkCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return this.updateDisplay()
|
||||
}
|
||||
|
||||
onInput() {}
|
||||
|
||||
select(option: Completions.CompletionOption) {
|
||||
if (this.lastExstr !== undefined && option !== undefined) {
|
||||
|
|
|
@ -51,7 +51,6 @@ export class ExtensionsCompletionSource extends Completions.CompletionSourceFuse
|
|||
return this.updateChain()
|
||||
}
|
||||
|
||||
onInput() {}
|
||||
|
||||
updateChain() {
|
||||
this.options.forEach(option => (option.state = "normal"))
|
||||
|
|
|
@ -144,5 +144,5 @@ export class HelpCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return this.updateDisplay()
|
||||
}
|
||||
|
||||
onInput() {}
|
||||
|
||||
}
|
||||
|
|
|
@ -99,9 +99,10 @@ export class HistoryCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return this.updateDisplay()
|
||||
}
|
||||
|
||||
// We don't need this inherited function
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
updateChain() {}
|
||||
|
||||
onInput() {}
|
||||
|
||||
private async scoreOptions(query: string, n: number) {
|
||||
if (!query || config.get("historyresults") === 0) {
|
||||
|
|
|
@ -98,5 +98,5 @@ export class SettingsCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return this.updateDisplay()
|
||||
}
|
||||
|
||||
onInput() {}
|
||||
|
||||
}
|
||||
|
|
|
@ -319,8 +319,8 @@ let modeState: HintState
|
|||
export function hintPage(
|
||||
hintableElements: Element[],
|
||||
onSelect: HintSelectedCallback,
|
||||
resolve = () => {},
|
||||
reject = () => {},
|
||||
resolve = () => {}, //eslint-disable-line @typescript-eslint/no-empty-function
|
||||
reject = () => {}, //eslint-disable-line @typescript-eslint/no-empty-function
|
||||
rapid = false,
|
||||
) {
|
||||
const buildHints: HintBuilder = defaultHintBuilder()
|
||||
|
|
|
@ -215,6 +215,9 @@ addEventListener(
|
|||
case "/static/docs/classes/_src_lib_config_.default_config.html":
|
||||
return onSettingsPageLoad
|
||||
}
|
||||
|
||||
// If we're on a different help page we don't need any side-effects
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
return () => {}
|
||||
})(),
|
||||
)
|
||||
|
|
|
@ -56,6 +56,7 @@ export class Logger {
|
|||
}
|
||||
|
||||
// do nothing with the message
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
return function(...args) {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue