mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
TSLint: re-enable one-variable-per-declaration rule
This commit is contained in:
parent
c5948c640d
commit
2ac27b0b1d
7 changed files with 31 additions and 27 deletions
|
@ -45,17 +45,16 @@ export class HelpCompletionSource extends Completions.CompletionSourceFuse {
|
|||
return
|
||||
}
|
||||
|
||||
let file, default_config, excmds, fns, settings, exaliases, bindings
|
||||
if (
|
||||
!(file = Metadata.everything.getFile("src/lib/config.ts")) ||
|
||||
!(default_config = file.getClass("default_config")) ||
|
||||
!(excmds = Metadata.everything.getFile("src/excmds.ts")) ||
|
||||
!(fns = excmds.getFunctions()) ||
|
||||
!(settings = config.get()) ||
|
||||
!(exaliases = settings.exaliases) ||
|
||||
!(bindings = settings.nmaps)
|
||||
)
|
||||
let file = Metadata.everything.getFile("src/lib/config.ts")
|
||||
let default_config = file.getClass("default_config")
|
||||
let excmds = Metadata.everything.getFile("src/excmds.ts")
|
||||
let fns = excmds.getFunctions()
|
||||
let settings = config.get()
|
||||
let exaliases = settings.exaliases
|
||||
let bindings = settings.nmaps
|
||||
if (fns === undefined || exaliases === undefined || bindings === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
const flags = {
|
||||
"-a": (options, query) =>
|
||||
|
@ -64,7 +63,7 @@ export class HelpCompletionSource extends Completions.CompletionSourceFuse {
|
|||
.filter(alias => alias.startsWith(query))
|
||||
.map(alias => {
|
||||
let cmd = aliases.expandExstr(alias)
|
||||
let doc = (excmds.getFunction(cmd) || {}).doc || ""
|
||||
let doc = (excmds.getFunction(cmd) || {} as any).doc || ""
|
||||
return new HelpCompletionOption(
|
||||
alias,
|
||||
`Alias for \`${cmd}\`. ${doc}`,
|
||||
|
@ -108,8 +107,8 @@ export class HelpCompletionSource extends Completions.CompletionSourceFuse {
|
|||
Object.keys(settings)
|
||||
.filter(x => x.startsWith(query))
|
||||
.map(setting => {
|
||||
let member,
|
||||
doc = ""
|
||||
let member
|
||||
let doc = ""
|
||||
if ((member = default_config.getMember(setting))) {
|
||||
doc = member.doc
|
||||
}
|
||||
|
|
|
@ -61,13 +61,13 @@ export class SettingsCompletionSource extends Completions.CompletionSourceFuse {
|
|||
|
||||
options += options ? " " : ""
|
||||
|
||||
let file, default_config, settings
|
||||
if (
|
||||
!(file = metadata.everything.getFile("src/lib/config.ts")) ||
|
||||
!(default_config = file.getClass("default_config")) ||
|
||||
!(settings = config.get())
|
||||
)
|
||||
let file = metadata.everything.getFile("src/lib/config.ts")
|
||||
let default_config = file.getClass("default_config")
|
||||
let settings = config.get()
|
||||
|
||||
if (default_config === undefined || settings === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
this.options = Object.keys(settings)
|
||||
.filter(x => x.startsWith(query))
|
||||
|
|
|
@ -3033,12 +3033,15 @@ export function searchsetkeyword() {
|
|||
function validateSetArgs(key: string, values: string[]) {
|
||||
const target: any[] = key.split(".")
|
||||
|
||||
let value, file, default_config, md
|
||||
if ((file = Metadata.everything.getFile("src/lib/config.ts")) && (default_config = file.getClass("default_config")) && (md = default_config.getMember(target[0]))) {
|
||||
let value
|
||||
let file = Metadata.everything.getFile("src/lib/config.ts")
|
||||
let default_config = file.getClass("default_config")
|
||||
let md = default_config.getMember(target[0])
|
||||
if (md !== undefined) {
|
||||
const strval = values.join(" ")
|
||||
// Note: the conversion will throw if strval can't be converted to the right type
|
||||
if (md.type.kind == "object" && target.length > 1) {
|
||||
value = md.type.convertMember(target.slice(1), strval)
|
||||
value = (md as any).type.convertMember(target.slice(1), strval)
|
||||
} else {
|
||||
value = md.type.convert(strval)
|
||||
}
|
||||
|
|
|
@ -508,7 +508,8 @@ export const backward_kill_line = wrap_input(
|
|||
**/
|
||||
export const kill_whole_line = wrap_input(
|
||||
needs_text((text, selectionStart, selectionEnd) => {
|
||||
let firstNewLine, secondNewLine
|
||||
let firstNewLine
|
||||
let secondNewLine
|
||||
// Find the newline before the caret
|
||||
for (
|
||||
firstNewLine = selectionStart;
|
||||
|
|
|
@ -9,8 +9,8 @@ export function linspace(a: number, b: number, n?: number) {
|
|||
if (n < 2) {
|
||||
return n === 1 ? [a] : []
|
||||
}
|
||||
var i,
|
||||
ret = Array(n)
|
||||
let i
|
||||
let ret = Array(n)
|
||||
n--
|
||||
for (i = n; i >= 0; i--) {
|
||||
ret[i] = (i * b + (n - i) * a) / n
|
||||
|
|
|
@ -26,7 +26,9 @@ function convertArgs(params, argv) {
|
|||
}
|
||||
|
||||
const typedArgs = []
|
||||
let type, arg, i
|
||||
let type
|
||||
let arg
|
||||
let i
|
||||
for ([type, [i, arg]] of izip(params.values(), enumerate(argv))) {
|
||||
if (type in conversions) {
|
||||
typedArgs.push(conversions[type](arg))
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
"no-variable-usage-before-declaration": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"ordered-imports": false,
|
||||
"prefer-const": false,
|
||||
|
|
Loading…
Add table
Reference in a new issue