mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
TSLint: re-enable whitespace rule
This commit is contained in:
parent
37dfddca4e
commit
0a8c3cd2f6
8 changed files with 20 additions and 21 deletions
|
@ -20,7 +20,7 @@ import state from "@src/state"
|
|||
import * as webext from "@src/lib/webext"
|
||||
import { AutoContain } from "@src/lib/autocontainers"
|
||||
/* tslint:disable:import-spacing */
|
||||
;(window as any).tri = Object.assign(Object.create(null), {
|
||||
; (window as any).tri = Object.assign(Object.create(null), {
|
||||
messaging,
|
||||
excmds,
|
||||
convert,
|
||||
|
@ -41,7 +41,7 @@ import { AutoContain } from "@src/lib/autocontainers"
|
|||
// {{{ tri.contentLocation
|
||||
// When loading the background, use the active tab to know what the current content url is
|
||||
browser.tabs.query({ currentWindow: true, active: true }).then(t => {
|
||||
;(window as any).tri.contentLocation = new URL(t[0].url)
|
||||
(window as any).tri.contentLocation = new URL(t[0].url)
|
||||
})
|
||||
// After that, on every tab change, update the current url
|
||||
let contentLocationCount = 0
|
||||
|
@ -52,7 +52,7 @@ browser.tabs.onActivated.addListener(ev => {
|
|||
// Note: we're using contentLocationCount and myId in order to make sure that only the last onActivated event is used in order to set contentLocation
|
||||
// This is needed because otherWise the following chain of execution might happen: onActivated1 => onActivated2 => tabs.get2 => tabs.get1
|
||||
if (contentLocationCount === myId) {
|
||||
;(window as any).tri.contentLocation = new URL(t.url)
|
||||
(window as any).tri.contentLocation = new URL(t.url)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -482,6 +482,6 @@ Messaging.addListener("commandline_frame", Messaging.attributeCaller(SELF))
|
|||
// object since there's apparently a bug that causes performance
|
||||
// observers to be GC'd even if they're still the target of a
|
||||
// callback.
|
||||
;(window as any).tri = Object.assign(window.tri || {}, {
|
||||
; (window as any).tri = Object.assign(window.tri || {}, {
|
||||
perfObserver: perf.listenForCounters(),
|
||||
})
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
if ((window as any).tridactyl_content_lock !== undefined) {
|
||||
throw Error("Trying to load Tridactyl, but it's already loaded.")
|
||||
}
|
||||
;(window as any).tridactyl_content_lock = "locked"
|
||||
(window as any).tridactyl_content_lock = "locked"
|
||||
|
||||
// Be careful: typescript elides imports that appear not to be used if they're
|
||||
// assigned to a name. If you want an import just for its side effects, make
|
||||
|
@ -74,7 +74,7 @@ import * as keyseq from "@src/lib/keyseq"
|
|||
import * as native from "@src/lib/native"
|
||||
import * as styling from "@src/content/styling"
|
||||
/* tslint:disable:import-spacing */
|
||||
;(window as any).tri = Object.assign(Object.create(null), {
|
||||
; (window as any).tri = Object.assign(Object.create(null), {
|
||||
browserBg: webext.browserBg,
|
||||
commandline_content,
|
||||
convert,
|
||||
|
@ -293,6 +293,6 @@ config.getAsync("leavegithubalone").then(v => {
|
|||
// background for collection. Attach the observer to the window object
|
||||
// since there's apparently a bug that causes performance observers to
|
||||
// be GC'd even if they're still the target of a callback.
|
||||
;(window as any).tri = Object.assign(window.tri, {
|
||||
; (window as any).tri = Object.assign(window.tri, {
|
||||
perfObserver: perf.listenForCounters(),
|
||||
})
|
||||
|
|
|
@ -201,7 +201,7 @@ export async function fillinput(selector: string, ...content: string[]) {
|
|||
let inputToFill = document.querySelector(selector)
|
||||
if (!inputToFill) inputToFill = DOM.getLastUsedInput()
|
||||
if ("value" in inputToFill) {
|
||||
;(inputToFill as HTMLInputElement).value = content.join(" ")
|
||||
(inputToFill as HTMLInputElement).value = content.join(" ")
|
||||
} else {
|
||||
inputToFill.textContent = content.join(" ")
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ document.addEventListener("load", () => curJumps().then(() => jumpprev(0)))
|
|||
/** Blur (unfocus) the active element */
|
||||
//#content
|
||||
export function unfocus() {
|
||||
;(document.activeElement as HTMLInputElement).blur()
|
||||
(document.activeElement as HTMLInputElement).blur()
|
||||
contentState.mode = "normal"
|
||||
}
|
||||
|
||||
|
@ -1046,7 +1046,7 @@ export async function open(...urlarr: string[]) {
|
|||
p = Messaging.message("controller_background", "acceptExCmd", ["nativeopen " + url])
|
||||
} else if (url.match(/^javascript:/)) {
|
||||
let bookmarklet = url.replace(/^javascript:/, "")
|
||||
;(document.body as any).append(
|
||||
; (document.body as any).append(
|
||||
html`
|
||||
<script>
|
||||
${bookmarklet}
|
||||
|
|
|
@ -93,7 +93,7 @@ async function onExcmdPageLoad() {
|
|||
browser.storage.onChanged.addListener((changes, areaname) => {
|
||||
if ("userconfig" in changes) {
|
||||
// JSON.stringify for comparisons like it's 2012
|
||||
;["nmaps", "imaps", "ignoremaps", "inputmaps", "exaliases"].forEach(
|
||||
["nmaps", "imaps", "ignoremaps", "inputmaps", "exaliases"].forEach(
|
||||
kind => {
|
||||
if (
|
||||
JSON.stringify(changes.userconfig.newValue[kind]) !==
|
||||
|
@ -130,7 +130,7 @@ function addSettingInputs() {
|
|||
let onKeyUp = async ev => {
|
||||
let input = ev.target
|
||||
if (ev.key === "Enter") {
|
||||
;(window as any).tri.messaging.message(
|
||||
(window as any).tri.messaging.message(
|
||||
"controller_background",
|
||||
"acceptExCmd",
|
||||
["set " + input.name + " " + input.value],
|
||||
|
@ -199,7 +199,7 @@ function addResetConfigButton() {
|
|||
`Please write '${sentence}' without quotes in the following input field if you really want to reset your Tridactyl config.`,
|
||||
)
|
||||
if (p === sentence) {
|
||||
;(window as any).tri.messaging
|
||||
(window as any).tri.messaging
|
||||
.message("controller_background", "acceptExCmd", [sentence])
|
||||
.then(_ => alert("Config reset!"))
|
||||
} else {
|
||||
|
|
|
@ -1126,7 +1126,7 @@ export async function update() {
|
|||
set("configversion", "1.2")
|
||||
},
|
||||
"1.2": () => {
|
||||
;["ignoremaps", "inputmaps", "imaps", "nmaps"]
|
||||
["ignoremaps", "inputmaps", "imaps", "nmaps"]
|
||||
.map(mapname => [
|
||||
mapname,
|
||||
getDeepProperty(USERCONFIG, [mapname]),
|
||||
|
@ -1158,7 +1158,7 @@ export async function update() {
|
|||
set("configversion", "1.3")
|
||||
},
|
||||
"1.3": () => {
|
||||
;[
|
||||
[
|
||||
"priority",
|
||||
"hintdelay",
|
||||
"scrollduration",
|
||||
|
@ -1171,7 +1171,7 @@ export async function update() {
|
|||
set("configversion", "1.4")
|
||||
},
|
||||
"1.4": () => {
|
||||
;(getDeepProperty(USERCONFIG, ["noiframeon"]) || []).forEach(
|
||||
(getDeepProperty(USERCONFIG, ["noiframeon"]) || []).forEach(
|
||||
site => {
|
||||
setURL(site, "noiframe", "true")
|
||||
},
|
||||
|
@ -1189,7 +1189,7 @@ export async function update() {
|
|||
mapObj["<Space>"] = mapObj[" "]
|
||||
delete mapObj[" "]
|
||||
}
|
||||
;[
|
||||
[
|
||||
"<A- >",
|
||||
"<C- >",
|
||||
"<M- >",
|
||||
|
@ -1209,7 +1209,7 @@ export async function update() {
|
|||
})
|
||||
return mapObj
|
||||
}
|
||||
;["nmaps", "exmaps", "imaps", "inputmaps", "ignoremaps"].forEach(
|
||||
["nmaps", "exmaps", "imaps", "inputmaps", "ignoremaps"].forEach(
|
||||
settingName => updateAll([settingName], updateSetting),
|
||||
)
|
||||
set("configversion", "1.7")
|
||||
|
|
|
@ -287,7 +287,7 @@ export function mapstrToKeyseq(mapstr: string): MinimalKey[] {
|
|||
// Reduce mapstr by one character or one bracket expression per iteration
|
||||
while (mapstr.length) {
|
||||
if (mapstr[0] === "<") {
|
||||
;[key, mapstr] = bracketexprToKey(mapstr)
|
||||
[key, mapstr] = bracketexprToKey(mapstr)
|
||||
keyseq.push(key)
|
||||
} else {
|
||||
keyseq.push(new MinimalKey(mapstr[0]))
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
"semicolon": false,
|
||||
"trailing-comma": false,
|
||||
"triple-equals": false,
|
||||
"variable-name": false,
|
||||
"whitespace": false
|
||||
"variable-name": false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue