Chore: make ESLint and TypeScript happy

This commit is contained in:
SukkaW
2025-08-07 22:28:15 +08:00
parent ce924cfd2e
commit 807fc19a46
7 changed files with 188 additions and 189 deletions

View File

@@ -46,9 +46,7 @@ export const downloadPreviousBuild = task(require.main === module, __filename)(a
// https://github.com/unjs/giget/issues/97
// https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2
'sec-fetch-mode': 'same-origin'
},
// Allow redirects by default
maxRedirections: 5
}
},
({ statusCode, body }) => {
if (statusCode !== 200) {

View File

@@ -139,10 +139,6 @@ export class ResponseError<T extends UndiciResponseData | Response> extends Erro
const statusCode = 'statusCode' in res ? res.statusCode : res.status;
super('HTTP ' + statusCode + ' ' + args.map(_ => inspect(_)).join(' '));
if ('captureStackTrace' in Error) {
Error.captureStackTrace(this, ResponseError);
}
// eslint-disable-next-line sukka/unicorn/custom-error-definition -- deliberatly use previous name
this.name = this.constructor.name;
this.res = res;

View File

@@ -25,7 +25,7 @@ export class FileOutput {
protected domainKeywords = new Set<string>();
private whitelistKeywords = new Set<string>();
private readonly whitelistKeywords = new Set<string>();
protected userAgent = new Set<string>();
protected processName = new Set<string>();

View File

@@ -35,7 +35,7 @@ export class SingboxSource extends BaseWriteStrategy {
static readonly jsonToLines = (json: unknown): string[] => stringify(json).split('\n');
private singbox: SingboxHeadlessRule = {
private readonly singbox: SingboxHeadlessRule = {
domain: [MARKER_DOMAIN],
domain_suffix: [MARKER_DOMAIN]
};

View File

@@ -148,7 +148,7 @@ export class SurgeMitmSgmodule extends BaseWriteStrategy {
readonly fileExtension = 'sgmodule';
readonly type = '';
private rules = new Set<string>();
private readonly rules = new Set<string>();
protected get result() {
if (this.rules.size === 0) {