TSLint: re-enable no-unnecessary-initializer rule

This commit is contained in:
glacambre 2019-04-10 06:47:46 +02:00
parent 3ff4713247
commit bd65146ca8
No known key found for this signature in database
GPG key ID: B9625DB1767553AC
10 changed files with 12 additions and 13 deletions

View file

@ -39,6 +39,7 @@ fi
# .bracketexpr.generated.ts is needed for metadata generation
(
printf '/* tslint:disable:no-trailing-whitespace */\n'
printf '/* tslint:disable:no-unnecessary-initializer */\n'
"$(npm bin)/nearleyc" src/grammars/bracketexpr.ne
) > src/grammars/.bracketexpr.generated.ts

View file

@ -13,7 +13,7 @@ export class Parser {
}
feedUntilError(input) {
let lastResult = undefined
let lastResult
let consumedIndex = 0
try {
for (let val of input) {

View file

@ -49,7 +49,7 @@ import * as tri_editor from "@src/lib/editor"
const logger = new Logger("cmdline")
/** @hidden **/
let activeCompletions: Completions.CompletionSource[] = undefined
let activeCompletions: Completions.CompletionSource[]
/** @hidden **/
let completionsDiv = window.document.getElementById("completions")
/** @hidden **/

View file

@ -140,8 +140,7 @@ function* ParserController() {
// unbounded length.
keyEvents.push(keyevent)
let response = undefined
response = parsers[contentState.mode](keyEvents)
let response = parsers[contentState.mode](keyEvents)
logger.debug(
currentMode,
contentState.mode,

View file

@ -93,7 +93,7 @@ class HintState {
}
}
let modeState: HintState = undefined
let modeState: HintState
/** For each hintable element, add a hint */
export function hintPage(

View file

@ -105,7 +105,7 @@ export async function scroll(
x: number = 0,
y: number = 0,
e: Node,
duration: number = undefined,
duration?: number,
) {
let smooth = await getSmooth()
if (smooth == "false") duration = 0
@ -145,8 +145,8 @@ let lastY = 0
export async function recursiveScroll(
x: number,
y: number,
node: Element = undefined,
stopAt: Element = undefined,
node?: Element,
stopAt?: Element,
) {
let startingFromCached = false
if (!node) {

View file

@ -1130,7 +1130,7 @@ export async function url2args() {
/** @hidden */
//#content_helper
let sourceElement = undefined
let sourceElement
/** @hidden */
//#content_helper
function removeSource() {
@ -1516,7 +1516,7 @@ export function urlparent(count = 1) {
//#content
export function urlmodify(mode: "-t" | "-r" | "-q" | "-Q" | "-g", ...args: string[]) {
let oldUrl = new URL(window.location.href)
let newUrl = undefined
let newUrl
switch (mode) {
case "-t":

View file

@ -84,7 +84,7 @@ export async function messageTab(tabId, type: TabMessageType, command, args?) {
return browserBg.tabs.sendMessage(tabId, message)
}
let _ownTabId = undefined
let _ownTabId
export async function messageOwnTab(type: TabMessageType, command, args?) {
if (_ownTabId === undefined) {
_ownTabId = await ownTabId()

View file

@ -8,7 +8,7 @@ class GobbleState {
public endCommand = ""
}
let modeState: GobbleState = undefined
let modeState: GobbleState
/** Init gobble mode. After parsing the defined number of input keys, execute
`endCmd` with attached parsed input. `Escape` cancels the mode and returns to

View file

@ -23,7 +23,6 @@
"no-identical-functions": false,
"no-shadowed-variable": false,
"no-string-throw": false,
"no-unnecessary-initializer": false,
"no-unsafe-finally": false,
"no-var-keyword": false,
"no-variable-usage-before-declaration": false,