Fix errors found by linter

This commit is contained in:
freearhey 2023-09-22 06:22:47 +03:00
parent efcae8e3b5
commit 21efb82055
24 changed files with 632 additions and 629 deletions

View file

@ -19,19 +19,19 @@ export class HTMLTable {
let output = '<table>\n'
output += ' <thead>\n <tr>'
for (let column of this.columns) {
for (const column of this.columns) {
output += `<th align="left">${column.name}</th>`
}
output += '</tr>\n </thead>\n'
output += ' <tbody>\n'
for (let item of this.data) {
for (const item of this.data) {
output += ' <tr>'
let i = 0
for (let prop in item) {
for (const prop in item) {
const column = this.columns[i]
let nowrap = column.nowrap ? ` nowrap` : ''
let align = column.align ? ` align="${column.align}"` : ''
const nowrap = column.nowrap ? ' nowrap' : ''
const align = column.align ? ` align="${column.align}"` : ''
output += `<td${align}${nowrap}>${item[prop]}</td>`
i++
}

View file

@ -11,7 +11,7 @@ const octokit = new CustomOctokit()
export class IssueLoader {
async load({ labels }: { labels: string[] | string }) {
labels = Array.isArray(labels) ? labels.join(',') : labels
let issues: any[] = []
let issues: object[] = []
if (TESTING) {
switch (labels) {
case 'streams:add':

View file

@ -1,6 +1,5 @@
import { Dictionary } from '@freearhey/core'
import { Issue } from '../models'
import _ from 'lodash'
const FIELDS = new Dictionary({
'Channel ID': 'channel_id',
@ -21,7 +20,7 @@ const FIELDS = new Dictionary({
})
export class IssueParser {
parse(issue: any): Issue {
parse(issue: { number: number; body: string; labels: { name: string }[] }): Issue {
const fields = issue.body.split('###')
const data = new Dictionary()

View file

@ -4,7 +4,7 @@ export type LogItem = {
}
export class LogParser {
parse(content: string): any[] {
parse(content: string): LogItem[] {
if (!content) return []
const lines = content.split('\n')

View file

@ -14,7 +14,7 @@ export class PlaylistParser {
async parse(files: string[]): Promise<Collection> {
let streams = new Collection()
for (let filepath of files) {
for (const filepath of files) {
const relativeFilepath = filepath.replace(path.normalize(STREAMS_DIR), '')
const _streams: Collection = await this.parseFile(relativeFilepath)
streams = streams.concat(_streams)