TSLint: re-activate array-type rule

This rule stipulates that complex array types should be represented as
Array<T> rather than T[].
This commit is contained in:
glacambre 2019-03-31 16:44:06 +02:00
parent a2cf6671f2
commit f5563c3d3e
No known key found for this signature in database
GPG key ID: B9625DB1767553AC
6 changed files with 7 additions and 7 deletions

View file

@ -410,7 +410,7 @@ function filterHintsSimple(fstr) {
*/ */
function filterHintsVimperator(fstr, reflow = false) { function filterHintsVimperator(fstr, reflow = false) {
/** Partition a fstr into a tagged array of substrings */ /** Partition a fstr into a tagged array of substrings */
function partitionFstr(fstr): { str: string; isHintChar: boolean }[] { function partitionFstr(fstr): Array<{ str: string; isHintChar: boolean }> {
const peek = a => a[a.length - 1] const peek = a => a[a.length - 1]
const hintChars = defaultHintChars() const hintChars = defaultHintChars()

View file

@ -1,3 +1,4 @@
/* tslint:disable:array-type */
// '//#' is a start point for a simple text-replacement-type macro. See excmds_macros.py // '//#' is a start point for a simple text-replacement-type macro. See excmds_macros.py
/** # Tridactyl help page /** # Tridactyl help page

View file

@ -325,7 +325,7 @@ export function getSelector(e: HTMLElement) {
*/ */
export function getElemsBySelector( export function getElemsBySelector(
selector: string, selector: string,
filters: Array<ElementFilter>, filters: ElementFilter[],
) { ) {
let elems = Array.from(document.querySelectorAll(selector)) let elems = Array.from(document.querySelectorAll(selector))
let frameElems = getAllDocumentFrames().reduce((acc, frame) => { let frameElems = getAllDocumentFrames().reduce((acc, frame) => {
@ -356,7 +356,7 @@ export function getElemsBySelector(
export function getNthElement( export function getNthElement(
selectors: string, selectors: string,
nth: number, nth: number,
filters: Array<ElementFilter>, filters: ElementFilter[],
): HTMLElement { ): HTMLElement {
let inputs = getElemsBySelector(selectors, filters) let inputs = getElemsBySelector(selectors, filters)

View file

@ -209,7 +209,7 @@ export function getDownloadFilenameForUrl(url: URL): string {
* *
* These could be like "query" or "query=val" * These could be like "query" or "query=val"
*/ */
function getUrlQueries(url: URL): Array<string> { function getUrlQueries(url: URL): string[] {
let qys = [] let qys = []
if (url.search) { if (url.search) {
@ -223,7 +223,7 @@ function getUrlQueries(url: URL): Array<string> {
/** /**
* Update a URL with a new array of queries * Update a URL with a new array of queries
*/ */
function setUrlQueries(url: URL, qys: Array<string>) { function setUrlQueries(url: URL, qys: string[]) {
url.search = "" url.search = ""
if (qys.length) { if (qys.length) {

View file

@ -20,7 +20,7 @@ const logger = new Logger("state")
class State { class State {
lastSearch: string = undefined lastSearch: string = undefined
cmdHistory: string[] = [] cmdHistory: string[] = []
prevInputs: { inputId: string; tab: number; jumppos?: number }[] = [ prevInputs: Array<{ inputId: string; tab: number; jumppos?: number }> = [
{ {
inputId: undefined, inputId: undefined,
tab: undefined, tab: undefined,

View file

@ -2,7 +2,6 @@
"extends": ["tslint:recommended", "tslint-sonarts"], "extends": ["tslint:recommended", "tslint-sonarts"],
"rules": { "rules": {
"align": false, "align": false,
"array-type": false,
"arrow-parens": false, "arrow-parens": false,
"ban-types": false, "ban-types": false,
"bool-param-default": false, "bool-param-default": false,