Chore: make ESLint Happy

This commit is contained in:
SukkaW
2024-10-10 21:40:54 +08:00
parent 40cda6997a
commit e40979e50e
31 changed files with 228 additions and 220 deletions

View File

@@ -125,6 +125,7 @@ export abstract class RuleOutput<TPreprocessed = unknown> {
}
private async addFromDomainsetPromise(source: AsyncIterable<string> | Iterable<string> | string[]) {
// eslint-disable-next-line @typescript-eslint/await-thenable -- https://github.com/typescript-eslint/typescript-eslint/issues/10080
for await (const line of source) {
if (line[0] === '.') {
this.addDomainSuffix(line);
@@ -140,6 +141,7 @@ export abstract class RuleOutput<TPreprocessed = unknown> {
}
private async addFromRulesetPromise(source: AsyncIterable<string> | Iterable<string>) {
// eslint-disable-next-line @typescript-eslint/await-thenable -- https://github.com/typescript-eslint/typescript-eslint/issues/10080
for await (const line of source) {
const splitted = line.split(',');
const type = splitted[0];
@@ -314,7 +316,7 @@ export abstract class RuleOutput<TPreprocessed = unknown> {
abstract mitmSgmodule?(): string[] | null;
}
export const fileEqual = async (linesA: string[], source: AsyncIterable<string>): Promise<boolean> => {
export async function fileEqual(linesA: string[], source: AsyncIterable<string>): Promise<boolean> {
if (linesA.length === 0) {
return false;
}
@@ -350,7 +352,7 @@ export const fileEqual = async (linesA: string[], source: AsyncIterable<string>)
// The file becomes larger
return !(index < linesA.length - 1);
};
}
export async function compareAndWriteFile(span: Span, linesA: string[], filePath: string) {
let isEqual = true;