Housekeeping & Make ESLint happy again

This commit is contained in:
SukkaW
2024-09-20 15:25:06 +08:00
parent bcb45e43f6
commit bdc3955ac6
7 changed files with 74 additions and 207 deletions

View File

@@ -2,7 +2,8 @@ import path from 'node:path';
import { pipeline } from 'node:stream/promises';
import { task } from './trace';
import { defaultRequestInit, fetchWithRetry } from './lib/fetch-retry';
import { extract as tarExtract, type Headers as TarEntryHeaders } from 'tar-fs';
import { extract as tarExtract } from 'tar-fs';
import type { Headers as TarEntryHeaders } from 'tar-fs';
import zlib from 'node:zlib';
import { Readable } from 'node:stream';

View File

@@ -1,4 +1,5 @@
import { createTrie, type Trie } from './trie';
import { createTrie } from './trie';
import type { Trie } from './trie';
export function domainsetDeduper(inputDomains: string[] | Trie): string[] {
let trie: Trie;

View File

@@ -1,7 +1,8 @@
import { processDomainLists } from './parse-filter';
import * as tldts from 'tldts-experimental';
import { dummySpan, type Span } from '../trace';
import { dummySpan } from '../trace';
import type { Span } from '../trace';
import { appendArrayInPlaceCurried } from './append-array-in-place';
import { PHISHING_DOMAIN_LISTS_EXTRA } from '../constants/reject-data-source';
import { loosTldOptWithPrivateDomains } from '../constants/loose-tldts-opt';

View File

@@ -1,6 +1,7 @@
import { describe, it } from 'mocha';
import { parse, processFilterRules, type ParseType } from './parse-filter';
import { parse, processFilterRules } from './parse-filter';
import type { ParseType } from './parse-filter';
import { createCacheKey } from './cache-filesystem';
import { createSpan } from '../trace';

View File

@@ -148,7 +148,7 @@ export { type ParseType };
export async function processFilterRules(
parentSpan: Span,
filterRulesUrl: string,
fallbackUrls?: readonly string[] | undefined | null,
fallbackUrls?: readonly string[] | null,
ttl: number | null = null
): Promise<{ white: string[], black: string[], foundDebugDomain: boolean }> {
const [white, black, warningMessages] = await parentSpan.traceChild(`process filter rules: ${filterRulesUrl}`).traceAsyncFn((span) => fsFetchCache.apply<Readonly<[